Temporary API keys are enabled so you can get started immediately.
+Access the dashboard to customize auth settings and explore Clerk features.
+ > + ), + cta: { + kind: 'link', + text: 'Configure your application', + href: ({ claimUrl }) => claimUrl, + }, + }, + userCreated: { + triggerWidth: '15.75rem', + title: "You've created your first user!", + description: ( +Head to the dashboard to customize authentication settings, view user info, and explore more features.
+ ), + cta: { + kind: 'link', + text: 'Configure your application', + href: ({ claimUrl }) => claimUrl, + }, + }, + claimed: { + triggerWidth: '14.25rem', + title: 'Missing environment keys', + description: ( ++ You claimed this application but haven't set keys in your environment. Get them from the Clerk Dashboard. +
+ ), + cta: { + kind: 'link', + text: 'Get API keys', + href: ({ claimUrl }) => claimUrl, + }, + }, + completed: { + triggerWidth: '10.5rem', + title: 'Your app is ready', + description: ({ appName, instanceUrl }) => ( ++ Your application{' '} + + {appName} + {' '} + has been configured. You may now customize your settings in the Clerk dashboard. +
+ ), + cta: { + kind: 'action', + text: 'Dismiss', + onClick: onDismiss => { + void onDismiss?.().then(() => { + window.location.reload(); + }); + }, + }, + }, +}; + +/** + * Determines the current state based on application lifecycle flags. + * State precedence: completed -> claimed -> userCreated -> idle + * + * Note: This is a structural refactor - the actual runtime behavior for + * `claimed` and `success` is determined by environment state and props. + * Currently, `claimed` comes from `environment.authConfig.claimedAt` and + * `success` is derived from `onDismiss` prop presence + claimed state. + */ +export function getCurrentState(claimed: boolean, success: boolean, isSignedIn: boolean): STATES { + if (success) { + return 'completed'; + } + if (claimed) { + return 'claimed'; + } + if (isSignedIn) { + return 'userCreated'; + } + return 'idle'; +} +type ResolvedContentContext = { + appName: string; + instanceUrl: string; + claimUrl: string; + onDismiss: (() => Promise- Your application{' '} - - {appName} - {' '} - has been claimed. Configure settings from the{' '} - ({ - color: t.colors.$whiteAlpha600, - textDecoration: 'underline solid', - transition: `${t.transitionTiming.$common} ${t.transitionDuration.$fast}`, - ':hover': { - color: t.colors.$whiteAlpha800, - }, - })} - > - Clerk Dashboard - -
- ) : claimed ? ( -- You claimed this application but haven't set keys in your environment. Get them from the Clerk - Dashboard. -
- ) : isSignedIn ? ( -- - You've created your first user! Link this application to your Clerk account to explore the - Dashboard. - -
- ) : ( - <> -- Temporary API keys are enabled so you can get started immediately. -
-- Claim this application to access the Clerk Dashboard where you can manage auth settings and explore - more Clerk features. -
- > - )} + {resolvedContent.description}