Returnstrue if a member token is stored. This is a cheap synchronous check and doesn’t validate the token with the API; a stale token will still return true until the SDK discovers it’s invalid (on load, or on the next member request) and signs the member out.
Open the Cashback Hive sign-in window and resolve with the member once they’ve signed in.
auth.signIn(): Promise<Member>
Behaviour
Opens a 480×640 popup to the sign-in page, passing your key, the current origin and the current URL.
Waits for the sign-in page to post a cbh:auth message back (origin-checked), or for a token to appear in localStorage from another tab.
Stores the token, fetches the member profile, emits auth:change, and resolves with the Member.
If the popup is blocked, the current page is redirected to the sign-in page instead and the promise never settles (the page unloads). The member is brought back afterwards and signed in on that load.In mock mode, resolves after ~300 ms with a sample member; no popup is opened.Rejects with an Error whose message is:
Message
Meaning
Sign-in window was closed
The member closed the popup before finishing. Treat as a cancel.
Sign-in failed or a specific message
The sign-in page reported an error.
Call signIn() directly from a user gesture such as a click handler. Browsers block window.open that isn’t triggered synchronously by user input.
button.addEventListener("click", async () => { try { const member = await sdk.auth.signIn(); console.log("Welcome,", member.displayName); } catch (err) { if (err.message !== "Sign-in window was closed") { console.error(err); } }});
Removes the stored token, clears the cached member, and emits auth:change with member: null. Synchronous; makes no network request.
sdk.auth.signOut();
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Cashback Hive","description":"Cashback SDK documentation for publishers. Add cashback offers, member sign-in and tracked affiliate links to any website with one script tag.","colors":{"primary":"#6b5bd6","light":"#8f82e6","dark":"#5154c4"},"logo":{"light":"https://mintcdn.com/cashback-hive-cebb35eb/EX8Nvw5J3Q3n7Cf5/logo/light.svg?fit=max\u0026auto=format\u0026n=EX8Nvw5J3Q3n7Cf5\u0026q=85\u0026s=d60ac62409de6513d36f9426615dfa46","dark":"https://mintcdn.com/cashback-hive-cebb35eb/EX8Nvw5J3Q3n7Cf5/logo/dark.svg?fit=max\u0026auto=format\u0026n=EX8Nvw5J3Q3n7Cf5\u0026q=85\u0026s=b10b94896e9644d7efe58acf6a3d2bd6","href":"https://www.cashbackhive.com"},"favicon":"https://mintcdn.com/cashback-hive-cebb35eb/EX8Nvw5J3Q3n7Cf5/favicon.svg?fit=max\u0026auto=format\u0026n=EX8Nvw5J3Q3n7Cf5\u0026q=85\u0026s=655f12351170cdcebecec5ca0bc06064","appearance":{"default":"light"},"background":{"color":{"light":"#ffffff","dark":"#121212"}},"navbar":{"links":[{"href":"https://www.cashbackhive.com","label":"cashbackhive.com"}]},"footer":{"socials":{"x":"https://twitter.com/cashbackhive","facebook":"https://facebook.com/cashbackhive","instagram":"https://instagram.com/cashbackhive"},"links":[{"header":"Company","items":[{"label":"About Us","href":"https://www.cashbackhive.com/about"},{"label":"How It Works","href":"https://www.cashbackhive.com/how-it-works"},{"label":"FAQ","href":"https://www.cashbackhive.com/faq"},{"label":"Contact","href":"https://www.cashbackhive.com/contact"}]},{"header":"Legal","items":[{"label":"Privacy Policy","href":"https://www.cashbackhive.com/privacy"},{"label":"Terms of Service","href":"https://www.cashbackhive.com/terms"}]}]},"seo":{"metatags":{"canonical":"https://developer.cashbackhive.com/sdk","og:site_name":"Cashback Hive","og:type":"website","og:locale":"en_US","twitter:card":"summary_large_image","twitter:site":"@cashbackhive","author":"Cashback Hive","robots":"index, follow, max-image-preview:large, max-snippet:-1"},"organization":{"id":"https://www.cashbackhive.com/#organization","name":"Cashback Hive","url":"https://www.cashbackhive.com","logo":"https://developer.cashbackhive.com/sdk/logo/light.svg","sameAs":["https://twitter.com/cashbackhive","https://facebook.com/cashbackhive","https://instagram.com/cashbackhive"]},"indexing":"navigable"},"fonts":{"family":"Vend Sans"},"thumbnails":{"preset":"classic","appearance":"light","surface":"brand","eyebrow":{"source":"group","style":"pill"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cashback-hive-cebb35eb","hasAudioNarration":false,"actualSubdomain":"cashback-hive-cebb35eb","customDomains":["developer.cashbackhive.com"],"gitSource":{"type":"artifacts","owner":"prod","repo":"fe377fdd2788f428c9d39da0","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6ae77645840fe1a6751d61ae"},"chroma":{"latestBuiltDeploymentHistoryId":"6ae77d61ee8b55c46b4c1d24","collectionId":"1cd527a0-c780-45ca-8a07-a95f24d1c1e0","liveDeploymentHistoryId":"6ae77d61ee8b55c46b4c1d24","schemaVersion":"v3"},"entitlements":{},"buildId":"6ae77f8d17411a97942e8496","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"API reference","count":8},{"language":"default","tag":"Guides","count":5},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"Installation","count":4},{"language":"default","tag":"Widgets","count":3},{"language":"default","tag":"Resources","count":1}]},"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":"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":"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":"llms-txt-v2","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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"reference/auth","slug":"/reference/auth","pageMetadata":{"title":"Auth","description":"Cashback Hive SDK auth API reference: check sign-in state and sign members in or out with auth.isSignedIn(), auth.signIn() and auth.signOut().","href":"/reference/auth"},"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: \"Cashback Hive SDK auth API reference: check sign-in state and sign members in or out with auth.isSignedIn(), auth.signIn() and auth.signOut().\"\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`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/guides/members-and-auth`,children:`Members and authentication`}),` for the full flow, including popup fallback and token storage.`]}),`\n`,_jsx(Heading,{level:`2`,id:`auth-issignedin`,children:_jsx(_components.code,{children:`auth.isSignedIn()`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`isSignedIn`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(): `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`boolean`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Returns`}),` `,_jsx(_components.code,{children:`true`}),` if a member token is stored. This is a cheap synchronous check and doesn’t validate the token with the API; a stale token will still return `,_jsx(_components.code,{children:`true`}),` until the SDK discovers it’s invalid (on load, or on the next member request) and signs the member out.`]}),`\n`,_jsx(Heading,{level:`2`,id:`auth-signin`,children:_jsx(_components.code,{children:`auth.signIn()`})}),`\n`,_jsx(_components.p,{children:`Open the Cashback Hive sign-in window and resolve with the member once they’ve signed in.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signIn`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(): `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Promise`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Member`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Behaviour`})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Opens a 480×640 popup to the sign-in page, passing your key, the current origin and the current URL.`}),`\n`,_jsxs(_components.li,{children:[`Waits for the sign-in page to post a `,_jsx(_components.code,{children:`cbh:auth`}),` message back (origin-checked), or for a token to appear in `,_jsx(_components.code,{children:`localStorage`}),` from another tab.`]}),`\n`,_jsxs(_components.li,{children:[`Stores the token, fetches the member profile, emits `,_jsx(_components.a,{href:`/reference/events#auth-change`,children:_jsx(_components.code,{children:`auth:change`})}),`, and resolves with the `,_jsx(_components.a,{href:`/reference/types#member`,children:_jsx(_components.code,{children:`Member`})}),`.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`If the popup is blocked, the current page is redirected to the sign-in page instead and the promise never settles (the page unloads). The member is brought back afterwards and signed in on that load.`}),`\n`,_jsxs(_components.p,{children:[`In `,_jsx(_components.a,{href:`/guides/local-development#option-2-mock-mode`,children:`mock mode`}),`, resolves after ~300 ms with a sample member; no popup is opened.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Rejects`}),` with an `,_jsx(_components.code,{children:`Error`}),` whose message is:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Message`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Sign-in window was closed`})}),_jsx(_components.td,{children:`The member closed the popup before finishing. Treat as a cancel.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Sign-in failed`}),` or a specific message`]}),_jsx(_components.td,{children:`The sign-in page reported an error.`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`signIn()`}),` directly from a user gesture such as a click handler. Browsers block `,_jsx(_components.code,{children:`window.open`}),` that isn’t triggered synchronously by user input.`]})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"click\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_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:` try`}),_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\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` member`}),_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\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signIn`}),_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\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Welcome,\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`member`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`displayName`}),_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:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_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:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Sign-in window was closed\"`}),_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\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_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`,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`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`auth-signout`,children:_jsx(_components.code,{children:`auth.signOut()`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signOut`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(): `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Removes the stored token, clears the cached member, and emits `,_jsx(_components.a,{href:`/reference/events#auth-change`,children:_jsx(_components.code,{children:`auth:change`})}),` with `,_jsx(_components.code,{children:`member: null`}),`. Synchronous; makes no network request.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signOut`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})]})}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":"Auth","description":"Cashback Hive SDK auth API reference: check sign-in state and sign members in or out with auth.isSignedIn(), auth.signIn() and auth.signOut().","href":"/reference/auth"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"auth.isSignedIn()","slug":"auth-issignedin","depth":2,"children":[]},{"title":"auth.signIn()","slug":"auth-signin","depth":2,"children":[]},{"title":"auth.signOut()","slug":"auth-signout","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"cashback-hive-cebb35eb","siteName":"Cashback Hive","title":"Auth - Cashback Hive","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-01T18:06:08.779Z","originalFileLocation":"reference/auth.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=\"light\"}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=\"Cashback Hive SDK auth API reference: check sign-in state and sign members in or out with auth.isSignedIn(), auth.signIn() and auth.signOut().\">\u003cmeta data-mint-head name=\"application-name\" content=\"Cashback Hive\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow, max-image-preview:large, max-snippet:-1\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_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/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_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/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_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/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_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/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_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/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_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/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_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/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Auth - Cashback Hive\">\u003cmeta data-mint-head property=\"og:description\" content=\"Cashback Hive SDK auth API reference: check sign-in state and sign members in or out with auth.isSignedIn(), auth.signIn() and auth.signOut().\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Cashback Hive\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developer.cashbackhive.com/sdk/reference/auth\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cashback-hive-cebb35eb.mintlify.app/_mintlify/api/og/v2?division=API+reference\u0026amp;title=Auth\u0026amp;description=Cashback+Hive+SDK+auth+API+reference%3A+check+sign-in+state+and+sign+members+in+or+out+with+auth.isSignedIn%28%29%2C+auth.signIn%28%29+and+auth.signOut%28%29.\u0026amp;theme=cabb3e0c01942118665bd7c6\u0026amp;signature=d0afabda2841566f1285614104c00160ec66b4beb62fb04e911245fbf2c36dda\">\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=\"Auth - Cashback Hive\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Cashback Hive SDK auth API reference: check sign-in state and sign members in or out with auth.isSignedIn(), auth.signIn() and auth.signOut().\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cashback-hive-cebb35eb.mintlify.app/_mintlify/api/og/v2?division=API+reference\u0026amp;title=Auth\u0026amp;description=Cashback+Hive+SDK+auth+API+reference%3A+check+sign-in+state+and+sign+members+in+or+out+with+auth.isSignedIn%28%29%2C+auth.signIn%28%29+and+auth.signOut%28%29.\u0026amp;theme=cabb3e0c01942118665bd7c6\u0026amp;signature=d0afabda2841566f1285614104c00160ec66b4beb62fb04e911245fbf2c36dda\">\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/cashback-hive-cebb35eb/ihdbgeb38IO54b_Q/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Cashback Hive\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6b5bd6\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"author\" content=\"Cashback Hive\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developer.cashbackhive.com/sdk/reference/auth\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/auth.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.cashbackhive.com/#organization\",\"name\":\"Cashback Hive\",\"url\":\"https://www.cashbackhive.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://developer.cashbackhive.com/sdk/logo/light.svg\"},\"sameAs\":[\"https://twitter.com/cashbackhive\",\"https://facebook.com/cashbackhive\",\"https://instagram.com/cashbackhive\"]},{\"@type\":\"WebSite\",\"@id\":\"https://developer.cashbackhive.com/sdk#website\",\"name\":\"Cashback Hive\",\"url\":\"https://developer.cashbackhive.com/sdk\",\"publisher\":{\"@id\":\"https://www.cashbackhive.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developer.cashbackhive.com/sdk/reference/auth#webpage\",\"url\":\"https://developer.cashbackhive.com/sdk/reference/auth\",\"name\":\"Auth\",\"description\":\"Cashback Hive SDK auth API reference: check sign-in state and sign members in or out with auth.isSignedIn(), auth.signIn() and auth.signOut().\",\"dateModified\":\"2026-11-01T18:06:08.779Z\",\"isPartOf\":{\"@id\":\"https://developer.cashbackhive.com/sdk#website\"},\"breadcrumb\":{\"@id\":\"https://developer.cashbackhive.com/sdk/reference/auth#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developer.cashbackhive.com/sdk/reference/auth#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API reference\",\"item\":\"https://developer.cashbackhive.com/sdk/reference/configuration\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Auth\",\"item\":\"https://developer.cashbackhive.com/sdk/reference/auth\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developer.cashbackhive.com/sdk/reference/auth#article\",\"headline\":\"Auth\",\"name\":\"Auth\",\"description\":\"Cashback Hive SDK auth API reference: check sign-in state and sign members in or out with auth.isSignedIn(), auth.signIn() and auth.signOut().\",\"url\":\"https://developer.cashbackhive.com/sdk/reference/auth\",\"mainEntityOfPage\":{\"@id\":\"https://developer.cashbackhive.com/sdk/reference/auth#webpage\"},\"dateModified\":\"2026-11-01T18:06:08.779Z\",\"publisher\":{\"@id\":\"https://www.cashbackhive.com/#organization\"},\"isPartOf\":{\"@id\":\"https://developer.cashbackhive.com/sdk#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Cashback Hive\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Cashback Hive","nav":{"global":null,"groups":[{"group":"Get started","pages":[{"title":"Cashback SDK","sidebarTitle":"Overview","href":"/index"},{"title":"Quickstart","href":"/quickstart"},{"title":"Keys and allowed origins","href":"/concepts/keys-and-origins"},{"title":"Lifecycle and readiness","href":"/concepts/lifecycle"}]},{"group":"Installation","pages":[{"title":"Plain HTML","href":"/installation/html"},{"title":"Next.js","href":"/installation/nextjs"},{"title":"React (Vite, CRA, Remix)","href":"/installation/react"},{"title":"Google Tag Manager","href":"/installation/gtm"}]},{"group":"Widgets","pages":[{"title":"Widgets overview","href":"/widgets/overview"},{"title":"Offers widget","href":"/widgets/offers"},{"title":"Activate widget","href":"/widgets/activate"}]},{"group":"Guides","pages":[{"title":"Members and authentication","href":"/guides/members-and-auth"},{"title":"Click tracking","href":"/guides/click-tracking"},{"title":"Local development","href":"/guides/local-development"},{"title":"Content Security Policy","href":"/guides/content-security-policy"},{"title":"Troubleshooting","href":"/guides/troubleshooting"}]},{"group":"API reference","pages":[{"title":"Configuration","href":"/reference/configuration"},{"title":"Offers","href":"/reference/offers"},{"title":"Member","description":"Cashback Hive SDK member API reference: read the signed-in member's profile, cashback balances and recent activity with member.current() and member.activity().","href":"/reference/member"},{"title":"Auth","href":"/reference/auth"},{"title":"Tracking","description":"Cashback Hive SDK tracking API reference: build tracked retailer URLs with trackingUrl() and open them with openOffer(), including click IDs and sub-IDs.","href":"/reference/tracking"},{"title":"Events","href":"/reference/events"},{"title":"Types","href":"/reference/types"},{"title":"Errors","href":"/reference/errors"}]},{"group":"Resources","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Auth - Cashback Hive","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}