WIDGET
Widget installation
Add the StartupCore chatbot to any HTML page.
Script tag
- <script
- src="https://cdn.startupcore.com/chatbot-widget.js"
- data-public-key="pk_live_xxx"
- data-bot-id="bot_123"
- async>
- </script>
Where publicKey comes from
POST /tenants/{tenantId}/api-keys with keyType public_widget and boundBotId. The response secret field is pk_live_... — that is your data-public-key.
Where botId comes from
POST /tenants/{tenantId}/chatbots after enabling chatbot entitlement. Use the returned bot id in data-bot-id.
Allowed domains
Set environment.allowedDomains before publish. Requests from other origins receive 403.
Local testing
Use data-api-base-url="http://localhost:4000" for local widget API (direct backend). Org portal BFF: http://localhost:3001/api/v1. Widget playground is for demos only.
Production CDN
https://cdn.startupcore.com/chatbot-widget.js — pin version in enterprise installs if needed.
Error states
401 — invalid public key or botId mismatch. 403 — domain not allowed. 429 — rate limited.
StartupCore dogfooding
startupcore.com uses the same flow: Tenant StartupCore Internal (internal_free), Workspace StartupCore Website, Environment Prod, Bot StartupCore Website Support Bot, key type public_widget. Example keys only in docs — never commit real pk_live values.