Settings
Connect website modal
A three-step dialog for connecting an external website to BTS analytics: enter the URL, add DNS records, then install a framework-specific SDK snippet and verify.
Available
Ports as-is
Examples
Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.
Connect website modal
Rendered live from Storybook
Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.
Props
The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state. Supply with `onOpenChange`. |
defaultOpen | boolean | false | Uncontrolled open state — how the open-on-mount stories work. |
onOpenChange | (open: boolean) => void | — | Undocumented — add TSDoc to the prop in the library. |
onConnect | (domain: string) => void | — | Fired with the extracted domain when Verify is pressed. |
onCopySnippet | (snippet: string, framework: WebsiteFramework) => void | — | Fired when the snippet's copy button is pressed. The caller owns the clipboard. |
step | number | — | Controlled step, 1–3. Supply with `onStepChange`. |
initialStep | number | 1 | Seeds the uncontrolled step — this is how each step becomes its own story. |
onStepChange | (step: number) => void | — | Undocumented — add TSDoc to the prop in the library. |
initialUrl | string | "" | Undocumented — add TSDoc to the prop in the library. |
initialDomain | string | "" | Seeds the domain shown on steps 2–3 without going through step 1. |
initialFramework | WebsiteFramework | "react" | Undocumented — add TSDoc to the prop in the library. |
initialCopied | boolean | false | Pins the copy button to its confirmed tick. |
verifying | boolean | false | Pins the Verify button to its spinner-and-disabled state. |
helpHref | string | "https://github.com/bts/analytics" | Undocumented — add TSDoc to the prop in the library. |
Reference
Transcribed from the component audit. If this disagrees with the source, the source is right.
- Source
src/components/settings/ConnectWebsiteModal.tsx- Portability
- Copies across unchanged — only the utils import path moves.
- Notes
- Open from analytics settings when a creator wants to track an outside site; the DNS step requires a resolved domain to display correctly, and Verify stays disabled while verification is in progress.