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.

Node.js SDK overview

API reference for @mythos-work/sdk — the official Mythos SDK for Node.js and TypeScript.

info

Just getting started? Quickstart: Next.js

Install​

bash
npm install @mythos-work/sdk

Exports​

ExportTypeDescription
handshakeRoutefunctionExpress Router for publish handshake
listingCallbackRoutefunctionExpress handler for listing registration callback
requireLaunchTokenfunctionExpress middleware — verify + consume ?lt=
verifyLaunchTokenfunctionLow-level JWT verify (prefer middleware)
reportUsagefunctionDebit Consumer wallet
MythosErrorclassBase error
MythosConfigErrorclassMissing/invalid SDK config
InvalidLaunchTokenErrorclassLaunch token failed claim validation
InsufficientFundsErrorclassWallet has no credits
SessionNotFoundErrorclassSession JTI not found
InvalidUsageErrorclassInvalid arguments passed to an SDK function
MythosSessiontypeSession object shape

MythosSession​

typescript
interface MythosSession {
userId: string;
email: string;
displayName: string;
listingId: string;
sessionJti: string;
}

Attached to req.mythos by requireLaunchToken middleware.

Browser​

Do not import server functions in client bundles. The browser build throws NOT_IMPLEMENTED for verify, middleware, and report functions.

Pages​