The four host events that touch the SDK: wire each one and you’re done.
Four host events interact with the SDK. The concepts are the same across both
SDKs (read the shared overview); this page gives
the exact Flutter code.
1. App launch (every time, including already-logged-in users)
The most common miss: existing users who installed your app before you added
ClarioDesk never hit the login flow again. Hydrate from your own session on
launch and identify unconditionally. identify() is idempotent and cheap.
externalId is your auth system’s stable user id (Firebase user.uid,
Clerk user.id, Auth0 user.sub) — never an auth token, never an email;
full table.
Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); await ClarioDesk.init(apiKey: 'pk_live_…'); final user = await yourAuth.currentUser(); // Firebase, Supabase, your store… if (user != null) { await ClarioDesk.identify( externalId: user.id, email: user.email, traits: {'plan': user.plan}, ); } runApp(const MyApp());}
This preserves the device key while changing the signed identity epoch. In
label-only mode, reset() is still available for full installation isolation.
Await clear before activating user B. reset() deprovisions this installation;
it is not logout or customer erase.
What if I never call identify()?
Tickets still work; agents see a device id but no email, and the dashboard shows
an “Unverified device” badge. This is fine for anonymous feedback; otherwise,
wire case 1.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ClarioDesk","description":"In-app support and bug reporting SDKs for Flutter, React Native, and native iOS (Swift).","colors":{"primary":"#809447","light":"#D4FF00","dark":"#5F6E36"},"logo":{"light":"https://mintcdn.com/clariodesk/nlEbZ2118mD971gH/logo/light.svg?fit=max\u0026auto=format\u0026n=nlEbZ2118mD971gH\u0026q=85\u0026s=05cf11cb6d111dd635cd7be420d87076","dark":"https://mintcdn.com/clariodesk/nlEbZ2118mD971gH/logo/dark.svg?fit=max\u0026auto=format\u0026n=nlEbZ2118mD971gH\u0026q=85\u0026s=b26fd941f305e7a38ecc72386de165ad"},"favicon":"https://mintcdn.com/clariodesk/nlEbZ2118mD971gH/favicon.svg?fit=max\u0026auto=format\u0026n=nlEbZ2118mD971gH\u0026q=85\u0026s=a741288538376c49b031a0c2ea29d72a","appearance":{"default":"dark"},"navbar":{"links":[{"href":"https://dashboard.clariodesk.com","label":"Dashboard"}],"primary":{"type":"button","label":"Get started","href":"https://clariodesk.com"}},"footer":{"socials":{"github":"https://github.com/clariodesk","website":"https://clariodesk.com"}},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode","mcp"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"clariodesk","hasAudioNarration":false,"actualSubdomain":"clariodesk","customDomains":["docs.clariodesk.com"],"gitSource":{"type":"github","owner":"shipwithdhruvil","repo":"clariodesk-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a94f06349c45aa1a0eb5673","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"Get started","count":15},{"language":"default","tag":"Core concepts","count":8},{"language":"default","tag":"React Native SDK","count":6},{"language":"default","tag":"React Native","count":6},{"language":"default","tag":"Swift SDK","count":6},{"language":"default","tag":"Swift","count":6},{"language":"default","tag":"Flutter SDK","count":5},{"language":"default","tag":"Flutter","count":5},{"language":"default","tag":"Integration","count":3},{"language":"default","tag":"Build with AI","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"flutter/lifecycle","slug":"/flutter/lifecycle","pageMetadata":{"title":"Flutter lifecycle","description":"The four host events that touch the SDK: wire each one and you're done.","href":"/flutter/lifecycle"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"The four host events that touch the SDK: wire each one and you’re done.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Four host events interact with the SDK. The concepts are the same across both\nSDKs (`,_jsx(_components.a,{href:`/concepts/identity-lifecycle`,children:`read the shared overview`}),`); this page gives\nthe exact Flutter code.`]}),`\n`,_jsx(Heading,{level:`2`,id:`1-app-launch-every-time-including-already-logged-in-users`,children:`1. App launch (every time, including already-logged-in users)`}),`\n`,_jsxs(_components.p,{children:[`The most common miss: existing users who installed your app before you added\nClarioDesk never hit the login flow again. Hydrate from your own session on\nlaunch and identify `,_jsx(_components.strong,{children:`unconditionally`}),`. `,_jsx(_components.code,{children:`identify()`}),` is idempotent and cheap.\n`,_jsx(_components.code,{children:`externalId`}),` is your auth system’s `,_jsx(_components.strong,{children:`stable user id`}),` (Firebase `,_jsx(_components.code,{children:`user.uid`}),`,\nClerk `,_jsx(_components.code,{children:`user.id`}),`, Auth0 `,_jsx(_components.code,{children:`user.sub`}),`) — never an auth token, never an email;\n`,_jsx(_components.a,{href:`/concepts/identity-lifecycle#which-value-is-externalid`,children:`full table`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`dart`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dart`,children:_jsxs(_components.code,{language:`dart`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Future`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` WidgetsFlutterBinding`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ensureInitialized`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ClarioDesk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`init`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(apiKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'pk_live_…'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` final`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` yourAuth.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`currentUser`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Firebase, Supabase, your store…`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (user `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ClarioDesk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`identify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` externalId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user.id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` email`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user.email,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` traits`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'plan'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user.plan},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` runApp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` MyApp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`2-fresh-login-or-signup`,children:`2. Fresh login or signup`}),`\n`,_jsx(_components.p,{children:`Right after your auth succeeds:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`dart`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dart`,children:_jsxs(_components.code,{language:`dart`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` yourAuth.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signIn`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(email, password);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ClarioDesk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`identify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` externalId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user.id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` email`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user.email,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` traits`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'plan'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user.plan},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This overwrites the label on the existing device row. The same device and\nhardware key are reused; nothing new is registered.`}),`\n`,_jsx(Heading,{level:`2`,id:`3-logout`,children:`3. Logout`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`dart`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dart`,children:_jsxs(_components.code,{language:`dart`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ClarioDesk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`clearIdentity`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Verified identity`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` yourAuth.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signOut`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This preserves the device key while changing the signed identity epoch. In\nlabel-only mode, `,_jsx(_components.code,{children:`reset()`}),` is still available for full installation isolation.`]}),`\n`,_jsx(Heading,{level:`2`,id:`4-user-switch-a-→-b-without-app-restart`,children:`4. User switch (A → B without app restart)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`dart`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dart`,children:_jsxs(_components.code,{language:`dart`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ClarioDesk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`clearIdentity`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` yourAuth.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`switchTo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(userB);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` ClarioDesk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`identify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(identityMode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` IdentityMode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.host);`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Await clear before activating user B. `,_jsx(_components.code,{children:`reset()`}),` deprovisions this installation;\nit is not logout or customer erase.`]})}),`\n`,_jsxs(Heading,{level:`2`,id:`what-if-i-never-call-identify-`,children:[`What if I never call `,_jsx(_components.code,{children:`identify()`}),`?`]}),`\n`,_jsx(_components.p,{children:`Tickets still work; agents see a device id but no email, and the dashboard shows\nan “Unverified device” badge. This is fine for anonymous feedback; otherwise,\nwire case 1.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Flutter lifecycle","description":"The four host events that touch the SDK: wire each one and you're done.","href":"/flutter/lifecycle"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"1. App launch (every time, including already-logged-in users)","slug":"1-app-launch-every-time-including-already-logged-in-users","depth":2,"children":[]},{"title":"2. Fresh login or signup","slug":"2-fresh-login-or-signup","depth":2,"children":[]},{"title":"3. Logout","slug":"3-logout","depth":2,"children":[]},{"title":"4. User switch (A → B without app restart)","slug":"4-user-switch-a-→-b-without-app-restart","depth":2,"children":[]},{"title":"What if I never call identify()?","slug":"what-if-i-never-call-identify-","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"clariodesk","siteName":"ClarioDesk","title":"Flutter lifecycle - ClarioDesk","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-23T03:47:08.113Z","originalFileLocation":"flutter/lifecycle.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"The four host events that touch the SDK: wire each one and you\u0026#x27;re done.\">\u003cmeta data-mint-head name=\"application-name\" content=\"ClarioDesk\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Flutter lifecycle - ClarioDesk\">\u003cmeta data-mint-head property=\"og:description\" content=\"The four host events that touch the SDK: wire each one and you\u0026#x27;re done.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ClarioDesk\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.clariodesk.com/flutter/lifecycle\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://clariodesk.mintlify.site/_mintlify/api/og/v2?division=Flutter\u0026amp;title=Flutter+lifecycle\u0026amp;description=The+four+host+events+that+touch+the+SDK%3A+wire+each+one+and+you%27re+done.\u0026amp;theme=03d21b49a97fe3c828410fd2\u0026amp;signature=7fe43e533bda7c35ea528cbbb68f607e800fa99524cb0f71a856cc03b78f7801\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Flutter lifecycle - ClarioDesk\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The four host events that touch the SDK: wire each one and you\u0026#x27;re done.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://clariodesk.mintlify.site/_mintlify/api/og/v2?division=Flutter\u0026amp;title=Flutter+lifecycle\u0026amp;description=The+four+host+events+that+touch+the+SDK%3A+wire+each+one+and+you%27re+done.\u0026amp;theme=03d21b49a97fe3c828410fd2\u0026amp;signature=7fe43e533bda7c35ea528cbbb68f607e800fa99524cb0f71a856cc03b78f7801\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/clariodesk/nVuqOLJh4xCQWkxU/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ClarioDesk\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#809447\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.clariodesk.com/flutter/lifecycle\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/flutter/lifecycle.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.clariodesk.com/#organization\",\"name\":\"ClarioDesk\",\"url\":\"https://docs.clariodesk.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/clariodesk/nlEbZ2118mD971gH/logo/light.svg?fit=max\u0026auto=format\u0026n=nlEbZ2118mD971gH\u0026q=85\u0026s=05cf11cb6d111dd635cd7be420d87076\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.clariodesk.com#website\",\"name\":\"ClarioDesk\",\"url\":\"https://docs.clariodesk.com\",\"publisher\":{\"@id\":\"https://docs.clariodesk.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.clariodesk.com/flutter/lifecycle#webpage\",\"url\":\"https://docs.clariodesk.com/flutter/lifecycle\",\"name\":\"Flutter lifecycle\",\"description\":\"The four host events that touch the SDK: wire each one and you're done.\",\"dateModified\":\"2026-08-23T03:47:08.113Z\",\"isPartOf\":{\"@id\":\"https://docs.clariodesk.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.clariodesk.com/flutter/lifecycle#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.clariodesk.com/flutter/lifecycle#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Flutter\",\"item\":\"https://docs.clariodesk.com/flutter/quickstart\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Flutter lifecycle\",\"item\":\"https://docs.clariodesk.com/flutter/lifecycle\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.clariodesk.com/flutter/lifecycle#article\",\"headline\":\"Flutter lifecycle\",\"name\":\"Flutter lifecycle\",\"description\":\"The four host events that touch the SDK: wire each one and you're done.\",\"url\":\"https://docs.clariodesk.com/flutter/lifecycle\",\"mainEntityOfPage\":{\"@id\":\"https://docs.clariodesk.com/flutter/lifecycle#webpage\"},\"dateModified\":\"2026-08-23T03:47:08.113Z\",\"publisher\":{\"@id\":\"https://docs.clariodesk.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.clariodesk.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ClarioDesk\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ClarioDesk\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/flutter/lifecycle.md","siteName":"ClarioDesk","nav":{"global":null,"tabs":[{"tab":"Get started","pages":[{"title":"Get started","href":""}]},{"tab":"Flutter SDK","groups":[{"group":"Flutter","pages":[{"title":"Flutter quickstart","href":"/flutter/quickstart"},{"title":"Flutter installation","description":"Add the package, set platform minimums, and configure iOS permissions.","href":"/flutter/installation"},{"title":"Flutter lifecycle","href":"/flutter/lifecycle"},{"title":"Flutter prebuilt UI","description":"Present a themeable support inbox with one call. No UI to build.","href":"/flutter/prebuilt-ui"},{"title":"Flutter API reference","href":"/flutter/api-reference"}]}]},{"tab":"React Native SDK","pages":[{"title":"React Native SDK","href":"/react-native/quickstart"}]},{"tab":"Swift SDK","pages":[{"title":"Swift SDK","href":"/swift/quickstart"}]}]},"basePath":"","title":"Flutter lifecycle - ClarioDesk","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":[],"chunks":[]}