Skip to content

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.

PropTypeDefaultDescription
openboolean—Controlled open state. Supply with `onOpenChange`.
defaultOpenbooleanfalseUncontrolled 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.
stepnumber—Controlled step, 1–3. Supply with `onStepChange`.
initialStepnumber1Seeds 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.
initialUrlstring""Undocumented — add TSDoc to the prop in the library.
initialDomainstring""Seeds the domain shown on steps 2–3 without going through step 1.
initialFrameworkWebsiteFramework"react"Undocumented — add TSDoc to the prop in the library.
initialCopiedbooleanfalsePins the copy button to its confirmed tick.
verifyingbooleanfalsePins the Verify button to its spinner-and-disabled state.
helpHrefstring"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.