Documentation Index
Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
Use this file to discover all available pages before exploring further.
Use the TypeScript SDK session APIs after authentication to restore wallet state, issue ID tokens, and manage credential access.
Session Restore
The default storage backend is browser localStorage when it is available. Non-browser runtimes use in-memory storage unless you provide a custom StorageManager. OIDC redirect state defaults to browser sessionStorage.
Browser signing defaults to a non-extractable WebCrypto P-256 credential stored through IndexedDB when available, so raw private key bytes are not written to localStorage.
import { MemoryStorageManager, OMSClient } from '@0xsequence/typescript-sdk'
const oms = new OMSClient({
publicApiKey: 'YOUR_PROJECT_ACCESS_KEY',
projectId: 'YOUR_PROJECT_ID',
storage: new MemoryStorageManager(),
redirectAuthStorage: new MemoryStorageManager(),
})
if (oms.wallet.session.walletAddress) {
console.log('Restored wallet:', oms.wallet.session.walletAddress)
}
Returns
oms.wallet.session returns OMSClientSessionState with walletAddress, expiresAt, loginType, and sessionEmail.
List Wallets
List wallets available to the authenticated credential.
const wallets = await oms.wallet.listWallets()
for (const wallet of wallets) {
console.log(wallet.id, wallet.type, wallet.address)
}
Parameters
Takes no parameters.
Returns
Returns Promise<OmsWallet[]>.
Get ID Token
Request an ID token for the active wallet session. Send this token to your backend when using backend wallet verification.
const idToken = await oms.wallet.getIdToken({
ttlSeconds: 300,
})
Parameters
| Parameter | Type | Description |
|---|
ttlSeconds | number or undefined | Optional token lifetime in seconds. |
customClaims | Record<string, unknown> or undefined | Optional custom claims to include in the token. |
Returns
Returns Promise<string>.
List Access
List credentials that currently have access to the active wallet.
const grants = await oms.wallet.listAccess()
for (const grant of grants) {
console.log(grant.credentialId, grant.expiresAt, grant.isCaller)
}
Parameters
| Parameter | Type | Description |
|---|
pageSize | number or undefined | Optional page size used while following Wallet API cursors. |
Returns
Returns Promise<AccessGrant[]>.
List Access Pages
Use listAccessPages when your UI should render credential access one page at a time.
for await (const page of oms.wallet.listAccessPages({ pageSize: 25 })) {
for (const grant of page.grants) {
console.log(grant.credentialId, grant.isCaller)
}
}
Parameters
| Parameter | Type | Description |
|---|
pageSize | number or undefined | Optional page size for each Wallet API request. |
Returns
Returns AsyncIterable<AccessGrantPage>.
Revoke Access
Revoke another credential’s access to the active wallet.
await oms.wallet.revokeAccess({
targetCredentialId: 'credential-id',
})
Parameters
| Parameter | Type | Description |
|---|
targetCredentialId | string | Credential ID returned by listAccess. |
Returns
Returns Promise<void>.
Sign Out
await oms.wallet.signOut()
Signing out clears wallet metadata from storage, pending OIDC redirect auth state, and the configured credential signer when supported.
Parameters
Takes no parameters.
Returns
Returns Promise<void>.