Widget setup, React setup, authenticated sessions, and allowed domains.
Add chatbot widget
Copy a single script tag into your site's body. The chat bubble appears automatically — no build step required.
<script src="https://cdn.startupcore.io/widget.js" data-key="pk_..."></script>
Add React component
Install the React package and drop the <Chatbot /> component anywhere in your component tree.
import { Chatbot } from "@startupcore/react";
<Chatbot publicKey="pk_..." botId="bot_..." />Create an authenticated session
Pass a user token from your server to the widget or component to persist chat history per signed-in user.
const session = await client.sessions.create({
botId: "bot_...",
userId: "user_123",
userToken: await signToken(user),
});Configure allowed domains
Add your site's domain in the environment settings. The API rejects widget requests from any origin not on the list.
// In your environment settings: // Allowed domains → add "https://example.com"
Sandbox keys
Use sandbox keys for local development and testing. Sandbox usage is isolated from production data and doesn't count toward your plan's production quota.
Production keys
Switch to production keys before launch. Make sure your domain is in the allowed list and your bot is published.
Key format
Sandbox keys start with pk_test_ and sk_test_. Production keys start with pk_live_ and sk_live_.