Skip to main content
Last updated on
Advanced — 0.0.x primitives

You don't need this page for a normal integration. Use the quickstarts and createMythos() instead. These low-level functions remain exported for custom setups.

verifyLaunchToken

Low-level launch token verification. Prefer requireLaunchToken middleware for route handlers.

Signature​

typescript
function verifyLaunchToken(
token: string,
options?: { resolveListingIds?: () => Promise<string[]> },
): Promise<MythosSession>

Parameters​

ParamTypeRequiredDescription
tokenstringYesLaunch JWT from ?lt=
options.resolveListingIds() => Promise<string[]>NoDynamic listing IDs from callback

Returns​

Promise<MythosSession> — does not call /consume. Use requireLaunchToken for single-use enforcement.

Validation​

  • ES256 signature via Mythos JWKS (cached 10 min, re-fetch on kid miss)
  • Issuer: mythos
  • Audience matches MYTHOS_LISTING_ID / MYTHOS_LISTING_IDS or resolveListingIds results

Throws​

ErrorCause
JWT verification errorsInvalid signature, expired, wrong issuer
ErrorNo listing IDs configured
ErrorAudience mismatch

Example​

typescript
import { verifyLaunchToken, reportUsage } from '@mythos-work/sdk';

const session = await verifyLaunchToken(token, {
resolveListingIds: async () => listingIds,
});
await reportUsage(session.sessionJti, { credits: 1, reason: 'action' });
warning

Calling verifyLaunchToken directly skips /consume. Only use when you implement consume yourself — otherwise use requireLaunchToken.

See also​