Build with Flowly's API
A clean REST API with streaming support, an embeddable widget with a JavaScript API, and an SDK for Node.js. Integrate Flowly into anything you build.
// Install
npm install @flowly/sdk
// Initialize
import { FlowlyClient } from '@flowly/sdk';
const client = new FlowlyClient({
apiKey: process.env.FLOWLY_API_KEY,
});
// Send a message (streaming)
const stream = await client.chat({
chatbotId: 'your-bot-id',
sessionId: 'user-session-123',
message: 'What is your return policy?',
});
for await (const chunk of stream) {
process.stdout.write(chunk.text);
}REST
API style
SSE
Streaming protocol
CORS
Cross-origin ready
JWT
Auth method
Widget API
The embed that developers actually like
One script tag to embed. A full window.Flowly JavaScript API to control it programmatically. Listen for events, open and close it, pre-populate messages.
Flowly.open()Open the chat widgetFlowly.close()Close the chat widgetFlowly.sendMessage(text)Inject a pre-filled messageFlowly.isOpen()Returns boolean widget stateflowly:message eventFires on every new messageflowly:open / flowly:closeWidget open/close lifecycle<!-- Add to any HTML page -->
<script
src="https://flowly.ai/embed.js"
data-chatbot-id="your-bot-id"
data-position="bottom-right"
async>
</script>
<!-- Control programmatically -->
<script>
// Open the chat widget
window.Flowly.open();
// Send a message
window.Flowly.sendMessage('Hello!');
// Listen for events
window.addEventListener('flowly:message', (e) => {
console.log('New message:', e.detail);
});
</script>REST API
Endpoint reference
/api/embed/chatbots/:idFetch public chatbot config (name, color, position, system prompt)
/api/embed/chatSend a message and receive a streaming SSE response
/api/chatbots/:id/messagesRetrieve full conversation history for a session (authenticated)
/api/chatbots/:id/knowledgeUpload a file to the chatbot's knowledge base (authenticated)
/api/dashboardAggregate stats across all bots (authenticated)
All public embed endpoints are CORS-enabled. Authenticated endpoints require a Bearer token.