WIDGET
Auth handoff
Bridge your app login to the embedded widget.
Flow
1) Visitor triggers a private quick-reply (auth_required). 2) Widget fires startupcore:auth-required. 3) Your app signs the user in. 4) Your BFF calls createAuthenticatedSession with secret_server key. 5) Browser calls startupCore.setSessionToken(sessionToken) — widget resumes the pending message.
Browser API
- window.addEventListener("startupcore:auth-required", (e) => {
- const { label } = e.detail;
- // open your login modal, then after BFF returns token:
- window.startupCore.setSessionToken(sessionToken, { tenantId, resumePendingAction: true });
- });
React
Same API after initWidgetWithConfig — import { setSessionToken } from '@startupcore/chatbot-widget' if you bundle the widget in-process.