Storeware Docs

Admin sessions

Prove who is looking at your app’s page in the admin.

import { ... } from '@storeware/plugin-sdk';

verifySession

Verifies a session token and returns its claims.

function verifySession(options: VerifySessionOptions): Promise<ExtensionSessionClaims>

SessionVerificationError

new SessionVerificationError(reason: string)

SessionContext

What the admin page around your extension had in context.

NameTypeDescription
selection?string[]

ExtensionSessionClaims

NameTypeDescription
issstringAlways https://storeware.ai.
audstringYour client id.
substringThe staff account viewing your extension.
expnumber
iatnumber
jtistring
sidstringThe installation, so you know which merchant's access token to use.
store_idstring
org_idstring
contextSessionContextWhat the surrounding page had in context, for example \{ productId \}.

VerifySessionOptions

NameTypeDescription
tokenstring
secretstringThe session_secret from your install response.
clientIdstringYour client id. A token minted for another app must not verify here.
nowSeconds?numberInjectable for tests.

On this page