Establish an OMS Wallet credential and activate a wallet with email or OIDC.
Authentication establishes a wallet credential. Wallet selection then turns that credential into an active wallet session. Protected wallet operations remain unavailable until a wallet is active.All auth completion methods use automatic wallet selection by default. Automatic selection activates a wallet of the requested type, Ethereum by default, in this order: the first wallet the user already owns, otherwise a preallocated wallet that the SDK claims, otherwise a newly created wallet.
signInWithOidcRedirect is the normal browser path for Google and Apple. Call completeOidcRedirectAuth when your application loads, then start the redirect from your sign-in UI.
import { OMSWallet, OmsRelayOidcProviders,} from '@polygonlabs/oms-wallet'const omsWallet = new OMSWallet({ publishableKey: 'YOUR_PUBLISHABLE_KEY',})await omsWallet.wallet.completeOidcRedirectAuth()if (omsWallet.wallet.activeWallet) { console.log('Active wallet:', omsWallet.wallet.activeWallet.address)}// Run this from the user's Google sign-in action.await omsWallet.wallet.signInWithOidcRedirect({ provider: OmsRelayOidcProviders.google,})
In a browser, the SDK uses the current page as the app return URL unless you pass omsRelayReturnUri. The wrapper stores transient redirect state, builds the authorization request, and navigates with window.location.assign. Callback completion validates the stored state, removes callback parameters from the browser URL by default, and returns undefined when the current URL is not the matching callback.OmsRelayOidcProviders.google and OmsRelayOidcProviders.apple are fixed OMS relay providers. Their client IDs, provider callback URLs, scopes, auth modes, and authorization parameters are SDK-owned and cannot be configured. Use a custom provider configuration when your application owns those settings.
Email authentication separates code delivery from code verification so your application can render its own OTP form.
await omsWallet.wallet.startEmailAuth({ email: 'user@example.com',})const result = await omsWallet.wallet.completeEmailAuth({ code: '123456',})console.log(result.wallet.address)console.log(result.credential.expiresAt)
startEmailAuth sends the code and keeps the pending attempt in memory. completeEmailAuth returns the active wallet, all wallets returned during auth, the claimableWallets that sign-in did not claim, and the credential created by the flow. credential.expiresAt is the expiry at sign-in; read the current expiry from omsWallet.wallet.session.
Use signInWithOidcIdToken when your application already received an ID token from an identity provider SDK or another provider flow. This idToken is provider-issued input that OMS validates. It is not the OMS Wallet ID token that getIdToken later issues for your backend.
The application must obtain providerIdToken itself and pass the exact issuer and audience used to mint it. provider and providerLabel only add display metadata to the completed session.
Use the lower-level pair when your router or navigation layer must inspect the authorization URL before redirecting.
const { authorizationUrl } = await omsWallet.wallet.startOidcRedirectAuth({ provider: OmsRelayOidcProviders.google, omsRelayReturnUri: `${window.location.origin}/auth/callback`,})window.location.assign(authorizationUrl)// On /auth/callback:const result = await omsWallet.wallet.completeOidcRedirectAuth()
For fixed relay providers, omsRelayReturnUri is your application callback. The OAuth provider itself returns to an OMS-owned relay URL derived from the publishable-key environment.
Custom providers default to authorization code with PKCE. The custom configuration owns scopes and default authorization parameters; per-call authorizeParams can add or override custom-provider parameters.
Sessions activate an Ethereum wallet by default. Pass walletType to sign in with a Solana or Tron wallet instead:
import { WalletType } from '@polygonlabs/oms-wallet'const result = await omsWallet.wallet.completeEmailAuth({ code: '123456', walletType: WalletType.Tron,})console.log(result.wallet.type, result.wallet.address)
WalletType has Ethereum, Solana, and Tron values. For email, pass walletType to completeEmailAuth. For OIDC ID-token auth, pass it to signInWithOidcIdToken. For redirects, pass it to signInWithOidcRedirect or startOidcRedirectAuth; callback completion uses the stored value. Automatic selection activates, claims, or creates a wallet of that type, and manual selection lists only wallets of that type.
Sessions last up to 180 days by default, which is also the maximum. Pass sessionLifetimeSeconds to request a shorter lifetime.The lifetime is an upper bound: a session also ends after 10 days without use. See sessions and access.For email, pass it to startEmailAuth. For OIDC ID-token auth, pass it to signInWithOidcIdToken. For redirects, pass it when starting the flow; callback completion uses the stored value unless you override it there.
Manual completion returns PendingWalletSelection. It contains a verified credential and wallet choices, but it is not an active wallet session. Complete that specific pending object with selectWallet, claimAndSelectWallet, or createAndSelectWallet. Starting another auth flow, signing out, expiring the credential, or completing a selection makes the pending object stale.The same walletSelection option is available for email, OIDC ID-token, and OIDC redirect completion.
Starting a new auth flow clears the current local wallet session before authentication continues. Do not use a sign-in action as an account-linking operation.
Your project can preallocate a receive-only wallet for a user’s email address through the OMS API, for example to fund it before the user signs in. When the user signs in and proves that email, with email OTP or an OIDC provider that reports a verified email, the wallet is claimable. Claiming makes the user its owner and lets the session sign with it.Sign-in is the only place claimable wallets are reported; listWallets includes a wallet only after it is claimed.
Automatic selection claims a claimable wallet of the requested type when the user owns none of that type. If the claim fails, sign-in fails; the SDK does not create a wallet instead.
result.claimableWallets on a completed sign-in lists the claimable wallets of every type that the sign-in did not claim. Claim one later with claimWallet.
selection.claimableWallets on a pending manual selection lists the claimable wallets of the requested type. selection.claimAndSelectWallet accepts only those IDs.
A rejected claim, for a wallet that is not allocated to the user’s verified email or was already claimed, throws OMSWalletRequestError with code OMS_REQUEST_FAILED, status 404, and upstreamError.name'AccountNotFound'. The active wallet and the pending selection are unchanged.See sessions and access for restored state, non-browser redirect storage, wallet switching and claiming, OMS Wallet backend ID tokens, revocation, and sign-out.
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Polygon Developer Docs","colors":{"primary":"#670DE5","light":"#9551F5","dark":"#500AB2"},"logo":{"light":"https://mintcdn.com/polygon-labs/ll1LL3IdpC3YxXZu/logo/light.svg?fit=max\u0026auto=format\u0026n=ll1LL3IdpC3YxXZu\u0026q=85\u0026s=d54ddb30492807a0eadf38093c075f2f","dark":"https://mintcdn.com/polygon-labs/ll1LL3IdpC3YxXZu/logo/dark.svg?fit=max\u0026auto=format\u0026n=ll1LL3IdpC3YxXZu\u0026q=85\u0026s=3b2b67f82ff1720328da11b176a86499"},"favicon":"https://mintcdn.com/polygon-labs/neKXk5towK-oBDip/favicon.png?fit=max\u0026auto=format\u0026n=neKXk5towK-oBDip\u0026q=85\u0026s=64034729f6d0b52274b3093da8c47b2c","api":{"openapi":"api-reference/openapi.yaml","params":{"expanded":"all"},"playground":{"display":"interactive"},"mdx":{"server":["https://sandbox-api.polygon.technology/v0.13","https://api.polygon.technology/v0.13"]}},"appearance":{"default":"light"},"navbar":{"links":[{"href":"/resources/build-with-ai","label":"Build with AI"},{"href":"https://polygon.technology/get-access?utm_source=docs\u0026utm_medium=navbar\u0026utm_campaign=oms_access","label":"Request OMS Access"}]},"footer":{"socials":{"x":"https://x.com/0xPolygon","github":"https://github.com/0xPolygon","linkedin":"https://www.linkedin.com/company/polygonlabs","discord":"https://discord.com/invite/polygon-support-635865020172861441"},"links":[{"items":[{"label":"Support","href":"https://support.polygon.technology/support/home"}]}]},"fonts":{"family":"Fustat"},"integrations":{"ga4":{"measurementId":"G-RJ6JC0EEY5"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"polygon-labs","hasAudioNarration":false,"actualSubdomain":"polygon-labs","customDomains":["docs.polygon.technology"],"gitSource":{"type":"github","owner":"0xpolygon","repo":"new-polygon-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae8c14972371a1bd634f2ba","collectionId":"b74c0e28-cb9c-4741-9fc3-0b7bcfb558f5","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae8c14972371a1bd634f2ba"},"feedback":{"contextualFeedback":{"allowEmail":true},"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae9e827847e2d921305f9d7","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"Polygon Chain","count":385},{"language":"default","tag":"Wallets","count":172},{"language":"default","tag":"Developer Tools","count":94},{"language":"default","tag":"API Reference","count":78},{"language":"default","tag":"Agglayer","count":73},{"language":"default","tag":"Platform","count":65},{"language":"default","tag":"SDK","count":61},{"language":"default","tag":"Matic.js","count":59},{"language":"default","tag":"Non-custodial","count":59},{"language":"default","tag":"Guides","count":48}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@polygon.technology","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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}],"starterQuestions":[{"_id":"69cbd3d67f226f107dbd9b72","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"Can I move assets between different chains with OMS?","status":"active","generatedBy":"manual","createdAt":"2026-03-31T14:01:58.134Z","updatedAt":"2026-03-31T14:01:58.134Z","__v":0},{"_id":"69cbd3b07f226f107dbd9a9b","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"What are my options for integrating a wallet?","status":"active","generatedBy":"manual","createdAt":"2026-03-31T14:01:20.206Z","updatedAt":"2026-03-31T14:01:20.206Z","__v":0},{"_id":"69cbd3737f226f107dbd9910","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"How does KYC / KYB work in OMS?","status":"active","generatedBy":"manual","createdAt":"2026-03-31T14:00:19.974Z","updatedAt":"2026-03-31T14:00:19.974Z","__v":0}],"googleFontsInlined":true},"customCss":[{"filePath":"custom.css","content":".nav-tabs{gap:0!important;align-items:center!important}div:has(>.nav-tabs){height:58px!important}.fam-grp .nav-tabs-item,.nav-tabs a.nav-tabs-item{padding:7px 12px!important;font-size:14px;font-weight:500;color:#64708f!important;transition:color 120ms ease,background 120ms ease}.fam-grp .nav-tabs-item:hover,.nav-tabs a.nav-tabs-item:hover{color:#141635!important}html.dark .fam-grp .nav-tabs-item,html.dark .nav-tabs a.nav-tabs-item{color:rgba(255,255,255,.55)!important}html.dark .fam-grp .nav-tabs-item:hover,html.dark .nav-tabs a.nav-tabs-item:hover{color:#fff!important}.fam-grp{display:inline-flex;align-items:center;gap:4px}.fam-gap{width:1px;height:22px;background:#dfe3f0;margin:0 16px;flex-shrink:0}.fam-grp .nav-tabs-item>div{display:none!important}.fam-grp .nav-tabs-item{border-radius:8px;white-space:nowrap;text-decoration:none;transition:color 120ms ease,background 120ms ease!important}.fam-grp .nav-tabs-item.fam-active-tab{background:#eae4f5!important;color:#500ab2!important;font-weight:500!important}.fam-grp .nav-tabs-item.fam-active-tab svg{color:#500ab2!important}html.dark .fam-gap{background:rgba(255,255,255,.14)}html.dark .fam-grp .nav-tabs-item.fam-active-tab{background:rgba(103,13,229,.22)!important;color:#a78bfa!important}html.dark .fam-grp .nav-tabs-item.fam-active-tab svg{color:#a78bfa!important}#navbar a[href*=build-with-ai]{background:#fff!important;color:#141635!important;border:1px solid #c8cfe1!important;font-weight:600!important;transition:border-color 140ms ease,background 140ms ease!important}#navbar a[href*=build-with-ai]:hover{border-color:#141635!important;background:#f6f6fc!important}html.dark #navbar a[href*=build-with-ai]{background:0 0!important;color:#fff!important;border-color:rgba(255,255,255,.25)!important}html.dark #navbar a[href*=build-with-ai]:hover{border-color:#fff!important;background:rgba(255,255,255,.06)!important}#navbar a[href*=get-access]{background:#0b0814!important;color:#fff!important;border:1px solid #0b0814!important;transition:background 140ms ease!important}#navbar a[href*=get-access]:hover{background:#2a2640!important}html.dark #navbar a[href*=get-access]{background:#fff!important;color:#0b0814!important;border-color:#fff!important}html.dark #navbar a[href*=get-access]:hover{background:#e5e7eb!important;border-color:#e5e7eb!important}#sidebar-content a.text-primary,#sidebar-content a[class*=text-primary-light]{background-color:transparent!important}#sidebar-content a:not(.text-primary):not([class*=text-primary-light]):hover{background-color:rgba(103,13,229,.06)!important}#content-area:has(.api-section) #page-title{font-size:1.75rem;line-height:2.25rem}#content-area:has(.api-section) #header .prose{font-size:.9375rem;line-height:1.6}@container page-header (min-width: 520px){#content-area:has(.api-section) #header:has(.eyebrow) .eyebrow{display:flex;align-items:center;min-height:2.25rem;padding-right:11rem}#content-area:has(.api-section) #header:has(.eyebrow) .eyebrow~div:has(#page-context-menu){position:static}#content-area:has(.api-section) #header:has(.eyebrow) .eyebrow~div #page-context-menu{position:absolute;top:0;right:0;margin:0}}.api-section[data-api-section=authorizations]:has(+.api-section[data-api-section=headers]) .api-section-heading-title{font-size:0}.api-section[data-api-section=authorizations]:has(+.api-section[data-api-section=headers]) .api-section-heading-title::after{content:\"Authorization and headers\";font-size:1.125rem}.api-section[data-api-section=authorizations]+.api-section[data-api-section=headers] .api-section-heading{display:none}.api-section[data-api-section=authorizations]:has(+.api-section[data-api-section=headers]) .primitive-param-field:last-child{border-bottom-width:1px}.api-section .api-section-heading .border-b,.api-section .primitive-param-field{border-color:#d1d5db}html.dark .api-section .api-section-heading .border-b,html.dark .api-section .primitive-param-field{border-color:#374151}.api-section .primitive-param-field>.py-6{padding-top:.875rem;padding-bottom:.875rem}.api-section .primitive-param-field .mt-4{margin-top:.5rem}@media (min-width:1600px){#body-content:has(.api-section){max-width:1760px}#body-content:has(.api-section) #content-container{max-width:1440px}}"}],"page":{"pagePath":"wallets/sdk/typescript/authentication","slug":"/wallets/sdk/typescript/authentication","pageMetadata":{"title":"TypeScript SDK authentication","sidebarTitle":"Authentication","description":"Establish an OMS Wallet credential and activate a wallet with email or OIDC.","href":"/wallets/sdk/typescript/authentication"},"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: \"Establish an OMS Wallet credential and activate a wallet with email or OIDC.\"\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`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._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:[_jsx(_components.p,{children:`Authentication establishes a wallet credential. Wallet selection then turns that credential into an active wallet session. Protected wallet operations remain unavailable until a wallet is active.`}),`\n`,_jsxs(_components.p,{children:[`All auth completion methods use automatic wallet selection by default. Automatic selection activates a wallet of the requested type, Ethereum by default, in this order: the first wallet the user already owns, otherwise a `,_jsx(_components.a,{href:`#claim-a-preallocated-wallet`,children:`preallocated wallet`}),` that the SDK claims, otherwise a newly created wallet.`]}),`\n`,_jsx(Heading,{level:`2`,id:`use-browser-redirect-sign-in`,children:`Use browser redirect sign-in`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`signInWithOidcRedirect`}),` is the normal browser path for Google and Apple. Call `,_jsx(_components.code,{children:`completeOidcRedirectAuth`}),` when your application loads, then start the redirect from your sign-in UI.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,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:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_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:` OMSWallet`}),_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:` OmsRelayOidcProviders`}),_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:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@polygonlabs/oms-wallet'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:` omsWallet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OMSWallet`}),_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:` publishableKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_PUBLISHABLE_KEY'`}),_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:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`completeOidcRedirectAuth`}),_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\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`activeWallet`}),_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:`'Active wallet:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`activeWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`address`}),_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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Run this from the user's Google sign-in action.`})}),`\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\":`#9CDCFE`},children:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signInWithOidcRedirect`}),_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:` provider:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OmsRelayOidcProviders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`google`}),_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`,_jsxs(_components.p,{children:[`In a browser, the SDK uses the current page as the app return URL unless you pass `,_jsx(_components.code,{children:`omsRelayReturnUri`}),`. The wrapper stores transient redirect state, builds the authorization request, and navigates with `,_jsx(_components.code,{children:`window.location.assign`}),`. Callback completion validates the stored state, removes callback parameters from the browser URL by default, and returns `,_jsx(_components.code,{children:`undefined`}),` when the current URL is not the matching callback.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`OmsRelayOidcProviders.google`}),` and `,_jsx(_components.code,{children:`OmsRelayOidcProviders.apple`}),` are fixed OMS relay providers. Their client IDs, provider callback URLs, scopes, auth modes, and authorization parameters are SDK-owned and cannot be configured. Use a custom provider configuration when your application owns those settings.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authenticate-with-email-otp`,children:`Authenticate with email OTP`}),`\n`,_jsx(_components.p,{children:`Email authentication separates code delivery from code verification so your application can render its own OTP form.`}),`\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:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`startEmailAuth`}),_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:` email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user@example.com'`}),_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:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` result`}),_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:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`completeEmailAuth`}),_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:` code:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '123456'`}),_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:`#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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`address`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`credential`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`expiresAt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`startEmailAuth`}),` sends the code and keeps the pending attempt in memory. `,_jsx(_components.code,{children:`completeEmailAuth`}),` returns the active `,_jsx(_components.code,{children:`wallet`}),`, all `,_jsx(_components.code,{children:`wallets`}),` returned during auth, the `,_jsx(_components.code,{children:`claimableWallets`}),` that sign-in did not claim, and the `,_jsx(_components.code,{children:`credential`}),` created by the flow. `,_jsx(_components.code,{children:`credential.expiresAt`}),` is the expiry at sign-in; read the current expiry from `,_jsx(_components.code,{children:`omsWallet.wallet.session`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authenticate-with-a-provider-id-token`,children:`Authenticate with a provider ID token`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`signInWithOidcIdToken`}),` when your application already received an ID token from an identity provider SDK or another provider flow. This `,_jsx(_components.code,{children:`idToken`}),` is provider-issued input that OMS validates. It is not the OMS Wallet ID token that `,_jsx(_components.code,{children:`getIdToken`}),` later issues for your backend.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,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:`9`,children:[_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:` result`}),_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:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signInWithOidcIdToken`}),_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:` idToken:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` providerIdToken`}),_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:` issuer:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://accounts.google.com'`}),_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:` audience:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_WEB_CLIENT_ID'`}),_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:` provider:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'google'`}),_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:` providerLabel:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Google'`}),_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:`#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:`'Active wallet:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`address`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The application must obtain `,_jsx(_components.code,{children:`providerIdToken`}),` itself and pass the exact issuer and audience used to mint it. `,_jsx(_components.code,{children:`provider`}),` and `,_jsx(_components.code,{children:`providerLabel`}),` only add display metadata to the completed session.`]}),`\n`,_jsx(Heading,{level:`2`,id:`control-browser-routing-directly`,children:`Control browser routing directly`}),`\n`,_jsx(_components.p,{children:`Use the lower-level pair when your router or navigation layer must inspect the authorization URL before redirecting.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,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:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`authorizationUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_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:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`startOidcRedirectAuth`}),_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:` provider:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OmsRelayOidcProviders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`google`}),_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:` omsRelayReturnUri:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`location`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`origin`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/auth/callback`\"}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`location`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assign`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`authorizationUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// On /auth/callback:`})}),`\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:` result`}),_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:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`completeOidcRedirectAuth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For fixed relay providers, `,_jsx(_components.code,{children:`omsRelayReturnUri`}),` is your application callback. The OAuth provider itself returns to an OMS-owned relay URL derived from the publishable-key environment.`]}),`\n`,_jsx(Heading,{level:`2`,id:`configure-a-custom-oidc-provider`,children:`Configure a custom OIDC provider`}),`\n`,_jsxs(_components.p,{children:[`A custom provider sends the OAuth callback directly to its `,_jsx(_components.code,{children:`providerRedirectUri`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,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:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` CustomOidcProviderConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@polygonlabs/oms-wallet'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:` provider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_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:` clientId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_WEB_CLIENT_ID'`}),_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:` issuer:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://issuer.example.com'`}),_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:` authorizationUrl:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://issuer.example.com/oauth2/authorize'`}),_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:` providerRedirectUri:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`location`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`origin`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/auth/callback`\"}),_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:` provider:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'corporate'`}),_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:` providerLabel:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Corporate SSO'`}),_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:` scopes:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'openid'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'email'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'profile'`}),_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:`satisfies`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` CustomOidcProviderConfig`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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\":`#9CDCFE`},children:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`signInWithOidcRedirect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Custom providers default to authorization code with PKCE. The custom configuration owns scopes and default authorization parameters; per-call `,_jsx(_components.code,{children:`authorizeParams`}),` can add or override custom-provider parameters.`]}),`\n`,_jsx(Heading,{level:`2`,id:`choose-a-wallet-type`,children:`Choose a wallet type`}),`\n`,_jsxs(_components.p,{children:[`Sessions activate an Ethereum wallet by default. Pass `,_jsx(_components.code,{children:`walletType`}),` to sign in with a Solana or Tron wallet instead:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,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:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`WalletType`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@polygonlabs/oms-wallet'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:` result`}),_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:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`completeEmailAuth`}),_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:` code:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '123456'`}),_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:` walletType:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` WalletType`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Tron`}),_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:`#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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`address`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`WalletType`}),` has `,_jsx(_components.code,{children:`Ethereum`}),`, `,_jsx(_components.code,{children:`Solana`}),`, and `,_jsx(_components.code,{children:`Tron`}),` values. For email, pass `,_jsx(_components.code,{children:`walletType`}),` to `,_jsx(_components.code,{children:`completeEmailAuth`}),`. For OIDC ID-token auth, pass it to `,_jsx(_components.code,{children:`signInWithOidcIdToken`}),`. For redirects, pass it to `,_jsx(_components.code,{children:`signInWithOidcRedirect`}),` or `,_jsx(_components.code,{children:`startOidcRedirectAuth`}),`; callback completion uses the stored value. Automatic selection activates, claims, or creates a wallet of that type, and manual selection lists only wallets of that type.`]}),`\n`,_jsx(Heading,{level:`2`,id:`set-session-lifetime`,children:`Set session lifetime`}),`\n`,_jsxs(_components.p,{children:[`Sessions last up to 180 days by default, which is also the maximum. Pass `,_jsx(_components.code,{children:`sessionLifetimeSeconds`}),` to request a shorter lifetime.`]}),`\n`,_jsxs(_components.p,{children:[`The lifetime is an upper bound: a session also ends after 10 days without use. See `,_jsx(_components.a,{href:`/wallets/sdk/typescript/sessions-and-access#keep-your-ui-in-sync`,children:`sessions and access`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`For email, pass it to `,_jsx(_components.code,{children:`startEmailAuth`}),`. For OIDC ID-token auth, pass it to `,_jsx(_components.code,{children:`signInWithOidcIdToken`}),`. For redirects, pass it when starting the flow; callback completion uses the stored value unless you override it there.`]}),`\n`,_jsx(Heading,{level:`2`,id:`present-your-own-wallet-selector`,children:`Present your own wallet selector`}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`walletSelection: 'manual'`}),` when your application must choose, claim, or create a wallet after identity verification.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,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:`17`,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\":`#9CDCFE`},children:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`startEmailAuth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user@example.com'`}),_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:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` selection`}),_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:` omsWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`completeEmailAuth`}),_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:` code:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '123456'`}),_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:` walletSelection:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'manual'`}),_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:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` existingWallet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` selection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallets`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_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:` claimableWallet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` selection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`claimableWallets`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_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:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` existingWallet`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_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:` selection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`selectWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`walletId:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` existingWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_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\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` claimableWallet`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_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:` selection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`claimAndSelectWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`walletId:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` claimableWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_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\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` selection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createAndSelectWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reference:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'main'`}),_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:`#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:`'Active wallet:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`address`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Manual completion returns `,_jsx(_components.code,{children:`PendingWalletSelection`}),`. It contains a verified credential and wallet choices, but it is not an active wallet session. Complete that specific pending object with `,_jsx(_components.code,{children:`selectWallet`}),`, `,_jsx(_components.code,{children:`claimAndSelectWallet`}),`, or `,_jsx(_components.code,{children:`createAndSelectWallet`}),`. Starting another auth flow, signing out, expiring the credential, or completing a selection makes the pending object stale.`]}),`\n`,_jsxs(_components.p,{children:[`The same `,_jsx(_components.code,{children:`walletSelection`}),` option is available for email, OIDC ID-token, and OIDC redirect completion.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Starting a new auth flow clears the current local wallet session before authentication continues. Do not use a sign-in action as an account-linking operation.`})}),`\n`,_jsx(Heading,{level:`2`,id:`claim-a-preallocated-wallet`,children:`Claim a preallocated wallet`}),`\n`,_jsx(_components.p,{children:`Your project can preallocate a receive-only wallet for a user’s email address through the OMS API, for example to fund it before the user signs in. When the user signs in and proves that email, with email OTP or an OIDC provider that reports a verified email, the wallet is claimable. Claiming makes the user its owner and lets the session sign with it.`}),`\n`,_jsxs(_components.p,{children:[`Sign-in is the only place claimable wallets are reported; `,_jsx(_components.code,{children:`listWallets`}),` includes a wallet only after it is claimed.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Automatic selection claims a claimable wallet of the requested type when the user owns none of that type. If the claim fails, sign-in fails; the SDK does not create a wallet instead.`}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`result.claimableWallets`}),` on a completed sign-in lists the claimable wallets of every type that the sign-in did not claim. Claim one later with `,_jsx(_components.a,{href:`/wallets/sdk/typescript/sessions-and-access#claim-a-preallocated-wallet`,children:_jsx(_components.code,{children:`claimWallet`})}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`selection.claimableWallets`}),` on a pending manual selection lists the claimable wallets of the requested type. `,_jsx(_components.code,{children:`selection.claimAndSelectWallet`}),` accepts only those IDs.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`A rejected claim, for a wallet that is not allocated to the user’s verified email or was already claimed, throws `,_jsx(_components.code,{children:`OMSWalletRequestError`}),` with code `,_jsx(_components.code,{children:`OMS_REQUEST_FAILED`}),`, status `,_jsx(_components.code,{children:`404`}),`, and `,_jsx(_components.code,{children:`upstreamError.name`}),` `,_jsx(_components.code,{children:`'AccountNotFound'`}),`. The active wallet and the pending selection are unchanged.`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/wallets/sdk/typescript/sessions-and-access`,children:`sessions and access`}),` for restored state, non-browser redirect storage, wallet switching and claiming, OMS Wallet backend ID tokens, revocation, and sign-out.`]})]})}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":"TypeScript SDK authentication","sidebarTitle":"Authentication","description":"Establish an OMS Wallet credential and activate a wallet with email or OIDC.","href":"/wallets/sdk/typescript/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Use browser redirect sign-in","slug":"use-browser-redirect-sign-in","depth":2,"children":[]},{"title":"Authenticate with email OTP","slug":"authenticate-with-email-otp","depth":2,"children":[]},{"title":"Authenticate with a provider ID token","slug":"authenticate-with-a-provider-id-token","depth":2,"children":[]},{"title":"Control browser routing directly","slug":"control-browser-routing-directly","depth":2,"children":[]},{"title":"Configure a custom OIDC provider","slug":"configure-a-custom-oidc-provider","depth":2,"children":[]},{"title":"Choose a wallet type","slug":"choose-a-wallet-type","depth":2,"children":[]},{"title":"Set session lifetime","slug":"set-session-lifetime","depth":2,"children":[]},{"title":"Present your own wallet selector","slug":"present-your-own-wallet-selector","depth":2,"children":[]},{"title":"Claim a preallocated wallet","slug":"claim-a-preallocated-wallet","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/polygon-labs/3aef159c73509324/analytics.js","/_mintlify/custom/polygon-labs/3af50e0aa9bbe82e/custom.js"],"subdomain":"polygon-labs","siteName":"Polygon Developer Docs","title":"TypeScript SDK authentication - Polygon Developer Docs","contextualStarterQuestions":[{"_id":"6ae37856f9f5684544037de7","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"How do I authenticate with email?","status":"active","generatedBy":"contextual","path":"wallets/sdk/typescript/authentication","createdAt":"2026-10-29T16:46:14.050Z","updatedAt":"2026-10-29T16:46:14.050Z","__v":0},{"_id":"6ae37856f9f5684544037de5","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"How do I set up OIDC sign-in?","status":"active","generatedBy":"contextual","path":"wallets/sdk/typescript/authentication","createdAt":"2026-10-29T16:46:14.050Z","updatedAt":"2026-10-29T16:46:14.050Z","__v":0},{"_id":"6ae37856f9f5684544037de6","deploymentId":"69a9bcc427671ec5a2e05f92","questionText":"What is automatic wallet selection?","status":"active","generatedBy":"contextual","path":"wallets/sdk/typescript/authentication","createdAt":"2026-10-29T16:46:14.050Z","updatedAt":"2026-10-29T16:46:14.050Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-29T16:46:06.002Z","originalFileLocation":"wallets/sdk/typescript/authentication.md"},"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=\"Establish an OMS Wallet credential and activate a wallet with email or OIDC.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Polygon Developer Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/polygon-labs/62XjF4p_S3sLlTMv/_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/polygon-labs/62XjF4p_S3sLlTMv/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/polygon-labs/62XjF4p_S3sLlTMv/_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/polygon-labs/62XjF4p_S3sLlTMv/_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/polygon-labs/62XjF4p_S3sLlTMv/_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/polygon-labs/62XjF4p_S3sLlTMv/_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/polygon-labs/62XjF4p_S3sLlTMv/_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/polygon-labs/62XjF4p_S3sLlTMv/_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/polygon-labs/62XjF4p_S3sLlTMv/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"TypeScript SDK authentication - Polygon Developer Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Establish an OMS Wallet credential and activate a wallet with email or OIDC.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Polygon Developer Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.polygon.technology/wallets/sdk/typescript/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://polygon-labs.mintlify.app/_mintlify/api/og/v2?division=TypeScript\u0026amp;title=TypeScript+SDK+authentication\u0026amp;description=Establish+an+OMS+Wallet+credential+and+activate+a+wallet+with+email+or+OIDC.\u0026amp;theme=430e64796fff481709b26ceb\u0026amp;signature=24c86f4416e743d4ee20609c7d6bfd4eb75e734a954bf1d27ecdfa65afab0d4d\">\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=\"TypeScript SDK authentication - Polygon Developer Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Establish an OMS Wallet credential and activate a wallet with email or OIDC.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://polygon-labs.mintlify.app/_mintlify/api/og/v2?division=TypeScript\u0026amp;title=TypeScript+SDK+authentication\u0026amp;description=Establish+an+OMS+Wallet+credential+and+activate+a+wallet+with+email+or+OIDC.\u0026amp;theme=430e64796fff481709b26ceb\u0026amp;signature=24c86f4416e743d4ee20609c7d6bfd4eb75e734a954bf1d27ecdfa65afab0d4d\">\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/polygon-labs/62XjF4p_S3sLlTMv/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Polygon Developer Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#670DE5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.polygon.technology/wallets/sdk/typescript/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/wallets/sdk/typescript/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.polygon.technology/#organization\",\"name\":\"Polygon Developer Docs\",\"url\":\"https://docs.polygon.technology\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/polygon-labs/ll1LL3IdpC3YxXZu/logo/light.svg?fit=max\u0026auto=format\u0026n=ll1LL3IdpC3YxXZu\u0026q=85\u0026s=d54ddb30492807a0eadf38093c075f2f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.polygon.technology#website\",\"name\":\"Polygon Developer Docs\",\"url\":\"https://docs.polygon.technology\",\"publisher\":{\"@id\":\"https://docs.polygon.technology/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.polygon.technology/wallets/sdk/typescript/authentication#webpage\",\"url\":\"https://docs.polygon.technology/wallets/sdk/typescript/authentication\",\"name\":\"TypeScript SDK authentication\",\"description\":\"Establish an OMS Wallet credential and activate a wallet with email or OIDC.\",\"dateModified\":\"2026-10-29T16:46:06.002Z\",\"isPartOf\":{\"@id\":\"https://docs.polygon.technology#website\"},\"breadcrumb\":{\"@id\":\"https://docs.polygon.technology/wallets/sdk/typescript/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.polygon.technology/wallets/sdk/typescript/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Wallets\",\"item\":\"https://docs.polygon.technology/wallets/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Non-custodial\",\"item\":\"https://docs.polygon.technology/wallets/non-custodial-wallets\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SDK\",\"item\":\"https://docs.polygon.technology/wallets/sdk/overview\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"TypeScript\",\"item\":\"https://docs.polygon.technology/wallets/sdk/typescript/quickstart\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"TypeScript SDK authentication\",\"item\":\"https://docs.polygon.technology/wallets/sdk/typescript/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.polygon.technology/wallets/sdk/typescript/authentication#article\",\"headline\":\"TypeScript SDK authentication\",\"name\":\"TypeScript SDK authentication\",\"description\":\"Establish an OMS Wallet credential and activate a wallet with email or OIDC.\",\"url\":\"https://docs.polygon.technology/wallets/sdk/typescript/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://docs.polygon.technology/wallets/sdk/typescript/authentication#webpage\"},\"dateModified\":\"2026-10-29T16:46:06.002Z\",\"publisher\":{\"@id\":\"https://docs.polygon.technology/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.polygon.technology#website\"}}]}\u003c/script>","siteName":"Polygon Developer Docs","nav":{"global":null,"tabs":[{"tab":"Platform","icon":"layer-group","pages":[{"title":"Platform","href":""}]},{"tab":"Payments","pages":[{"title":"Payments","href":"/payments/overview"}]},{"tab":"Wallets","groups":[{"group":"Wallets","expanded":true,"pages":[{"title":"OMS wallets","sidebarTitle":"Overview","href":"/wallets/overview"},{"group":"Custodial","expanded":true,"pages":[{"title":"OMS Custodial Wallets","sidebarTitle":"Overview","href":"/wallets/custodial-wallets"},{"title":"Custodial wallet quickstart","sidebarTitle":"Quickstart","href":"/wallets/custodial-wallets-quickstart"},{"title":"OMS fiat wallets","sidebarTitle":"Fiat wallets","href":"/wallets/fiat-wallets"},{"group":"Server Wallets","pages":[{"title":"Server Wallets","sidebarTitle":"Overview","href":"/wallets/server-wallets"},{"group":"SDK","pages":[{"title":"Server Wallet SDK quickstart","sidebarTitle":"Quickstart","href":"/wallets/sdk/server/quickstart"},{"title":"Identity and credentials","sidebarTitle":"Identity and credentials","href":"/wallets/sdk/server/identity-and-credentials"},{"title":"Storage and concurrency","sidebarTitle":"Storage and concurrency","href":"/wallets/sdk/server/storage-and-concurrency"},{"title":"Transfers","sidebarTitle":"Transfers","href":"/wallets/sdk/server/transfers"},{"title":"Swaps","sidebarTitle":"Swaps","href":"/wallets/sdk/server/swaps"},{"title":"Sign and verify","sidebarTitle":"Sign and verify","href":"/wallets/sdk/server/sign-and-verify"},{"title":"Balances","sidebarTitle":"Balances","href":"/wallets/sdk/server/balances"}]}]}]},{"group":"Non-custodial","expanded":true,"pages":[{"title":"OMS Non-Custodial Wallets","sidebarTitle":"Overview","href":"/wallets/non-custodial-wallets"},{"title":"SDK Quickstart","sidebarTitle":"Quickstart","href":"/wallets/quickstart"},{"group":"Features","pages":[{"title":"Authentication","href":"/wallets/authentication"},{"title":"Wallet Operations","href":"/wallets/wallet-operations"},{"title":"Gas Sponsorship","href":"/wallets/gas-sponsorship"},{"title":"Smart Sessions","href":"/wallets/smart-sessions"},{"title":"Private Send","href":"/wallets/private-send"},{"title":"Recovery","href":"/wallets/recovery"},{"title":"Security","href":"/wallets/security"}]},{"group":"SDK","pages":[{"title":"OMS Wallet SDKs","sidebarTitle":"Overview","href":"/wallets/sdk/overview"},{"group":"Guides","pages":[{"title":"Send USDC","sidebarTitle":"Send USDC","href":"/wallets/sdk/guides/send-usdc"},{"title":"Swap wallet assets","sidebarTitle":"Swap","href":"/wallets/sdk/guides/swap"},{"title":"Earn with Trails","sidebarTitle":"Earn","href":"/wallets/sdk/guides/earn"},{"title":"Backend wallet verification","sidebarTitle":"Backend verification","href":"/wallets/sdk/guides/backend-wallet-verification"},{"title":"Manage smart sessions from a backend","sidebarTitle":"Backend smart sessions","href":"/wallets/sdk/guides/backend-smart-sessions"},{"title":"Preallocate and claim wallets","sidebarTitle":"Claimable wallets","href":"/wallets/sdk/guides/claimable-wallets"}]},{"group":"TypeScript","pages":[{"title":"TypeScript SDK quickstart","sidebarTitle":"Quickstart","description":"Install the TypeScript OMS Wallet SDK, authenticate a wallet, and send a Polygon Amoy transaction.","href":"/wallets/sdk/typescript/quickstart"},{"title":"TypeScript SDK authentication","sidebarTitle":"Authentication","href":"/wallets/sdk/typescript/authentication"},{"title":"TypeScript sessions and access","sidebarTitle":"Sessions and access","description":"Restore wallet sessions, create or import wallets, issue backend tokens, and manage direct or remote access.","href":"/wallets/sdk/typescript/sessions-and-access"},{"title":"Send transactions with TypeScript","sidebarTitle":"Send transactions","href":"/wallets/sdk/typescript/send-transactions"},{"title":"Sign and verify with TypeScript","sidebarTitle":"Sign and verify","href":"/wallets/sdk/typescript/sign-and-verify"},{"title":"TypeScript balances and history","sidebarTitle":"Balances and history","href":"/wallets/sdk/typescript/balances-and-history"},{"title":"TypeScript networks","sidebarTitle":"Networks","href":"/wallets/sdk/typescript/networks-and-reference"},{"title":"Migrate the TypeScript SDK from 0.3 to 0.4","sidebarTitle":"Migrate from 0.3","href":"/wallets/sdk/typescript/migrate-from-0-3"},{"title":"TypeScript API reference","sidebarTitle":"API reference","href":"/wallets/sdk/typescript/api-reference"},{"title":"Use the TypeScript SDK with wagmi","sidebarTitle":"Using with wagmi","href":"/wallets/sdk/typescript/using-with-wagmi-connector"}]},{"group":"React Native","pages":[{"title":"React Native SDK quickstart","sidebarTitle":"Quickstart","href":"/wallets/sdk/react-native/quickstart"},{"title":"React Native authentication","sidebarTitle":"Authentication","href":"/wallets/sdk/react-native/authentication"},{"title":"React Native sessions and access","sidebarTitle":"Sessions and access","href":"/wallets/sdk/react-native/sessions-and-access"},{"title":"Send transactions with React Native","sidebarTitle":"Send transactions","href":"/wallets/sdk/react-native/send-transactions"},{"title":"Sign and verify with React Native","sidebarTitle":"Sign and verify","href":"/wallets/sdk/react-native/sign-and-verify"},{"title":"React Native balances and history","sidebarTitle":"Balances and history","href":"/wallets/sdk/react-native/balances-and-history"},{"title":"React Native networks","sidebarTitle":"Networks","href":"/wallets/sdk/react-native/networks-and-reference"},{"title":"React Native API reference","sidebarTitle":"API reference","href":"/wallets/sdk/react-native/api-reference"}]},{"group":"Swift","pages":[{"title":"Swift SDK quickstart","sidebarTitle":"Quickstart","href":"/wallets/sdk/swift/quickstart"},{"title":"Swift SDK authentication","sidebarTitle":"Authentication","href":"/wallets/sdk/swift/authentication"},{"title":"Swift sessions and access","sidebarTitle":"Sessions and access","href":"/wallets/sdk/swift/sessions-and-access"},{"title":"Send transactions with Swift","sidebarTitle":"Send transactions","href":"/wallets/sdk/swift/send-transactions"},{"title":"Sign and verify with Swift","sidebarTitle":"Sign and verify","href":"/wallets/sdk/swift/sign-and-verify"},{"title":"Swift balances and history","sidebarTitle":"Balances and history","href":"/wallets/sdk/swift/balances-and-history"},{"title":"Swift networks","sidebarTitle":"Networks","href":"/wallets/sdk/swift/networks-and-reference"},{"title":"Migrate the Swift SDK from 0.3 to 0.4","sidebarTitle":"Migrate from 0.3","href":"/wallets/sdk/swift/migrate-from-0-3"},{"title":"Swift API reference","sidebarTitle":"API reference","href":"/wallets/sdk/swift/api-reference"}]},{"group":"Kotlin","pages":[{"title":"Kotlin SDK quickstart","sidebarTitle":"Quickstart","href":"/wallets/sdk/kotlin/quickstart"},{"title":"Kotlin SDK authentication","sidebarTitle":"Authentication","href":"/wallets/sdk/kotlin/authentication"},{"title":"Kotlin SDK sessions and access","sidebarTitle":"Sessions and access","href":"/wallets/sdk/kotlin/sessions-and-access"},{"title":"Kotlin SDK send transactions","sidebarTitle":"Send transactions","href":"/wallets/sdk/kotlin/send-transactions"},{"title":"Kotlin SDK sign and verify","sidebarTitle":"Sign and verify","href":"/wallets/sdk/kotlin/sign-and-verify"},{"title":"Kotlin SDK balances and history","sidebarTitle":"Balances and history","href":"/wallets/sdk/kotlin/balances-and-history"},{"title":"Kotlin SDK networks","sidebarTitle":"Networks","href":"/wallets/sdk/kotlin/networks-and-reference"},{"title":"Migrate the Kotlin SDK from 0.3 to 0.4","sidebarTitle":"Migrate from 0.3","href":"/wallets/sdk/kotlin/migrate-from-0-3"},{"title":"Kotlin API reference","sidebarTitle":"API reference","href":"/wallets/sdk/kotlin/api-reference"}]}]},{"group":"Examples","pages":[{"title":"Interactive Demo","mode":"wide","href":"/wallets/examples/interactive-demo"},{"title":"Neobank iOS Demo","href":"/wallets/examples/neobank-ios"},{"title":"Hosted Wallet","href":"/wallets/hosted-wallet"},{"title":"Custom Wallet","href":"/wallets/custom-wallet"},{"title":"Automate USDC collection with a Treasury Wallet","sidebarTitle":"Treasury Wallet","href":"/wallets/treasury-wallet"},{"title":"Offer Yield Accounts to Your Users","sidebarTitle":"Offer Yield Accounts","href":"/wallets/morpho-vault-deposit"},{"title":"Agentic Wallets","href":"/wallets/agentic-wallets-overview"}]}]},{"group":"Technical Reference","expanded":true,"pages":[{"title":"OMS Wallet Architecture","href":"/wallets/architecture"},{"title":"Smart Sessions: Technical Deep Dive","href":"/wallets/smart-sessions-deep-dive"},{"title":"Wallet Configuration","href":"/wallets/wallet-configuration"},{"title":"Guard Firewall","href":"/wallets/guard-firewall"},{"title":"OMS Wallet Infrastructure","href":"/wallets/infrastructure"},{"title":"Timed Recovery: Technical Reference","href":"/wallets/timed-recovery-technical"},{"title":"Multi-Auth Linking","href":"/wallets/multi-auth-linking"},{"title":"Supported networks","sidebarTitle":"Supported networks","mode":"wide","href":"/wallets/supported-networks"}]}]}]},{"tab":"Cross-chain","pages":[{"title":"Cross-chain","href":"/cross-chain"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"Infrastructure","icon":"server","pages":[{"title":"Infrastructure","href":"/infrastructure"}]},{"tab":"Polygon Chain","pages":[{"title":"Polygon Chain","href":"/pos/overview"}]},{"tab":"Polygon CDK","pages":[{"title":"Polygon CDK","href":"/chain-development/cdk"}]},{"tab":"Agglayer","pages":[{"title":"Agglayer","href":"/interoperability/overview"}]},{"tab":"Agentic","pages":[{"title":"Agentic","href":"/payment-services/agentic-payments/agent-integration/intro"}]}]},"basePath":"","title":"TypeScript SDK authentication - Polygon Developer Docs","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":[],"chunks":[]}