Skip to content

@xtandard/kit/tokens

@xtandard/kit/tokens — scoped HMAC tokens (the products’ portal and viewer tokens): <prefix><payload>.<signature>, WebCrypto only, with secret rotation.

import { … } from "@xtandard/kit/tokens";
Name Summary
createScopedTokens Create a product’s scoped-token codec.
Name Summary
TokenError Base class of every scoped-token error. Maps to HTTP 401 at the API layer.
Name Summary
CreateTokenOptions Per-call options for ScopedTokens.create.
ScopedTokens What createScopedTokens returns.
ScopedTokensOptions Options for createScopedTokens.
VerifiedToken A verified token: its claims and expiry.
Name Summary
TokenSecret One secret, or a rotation list (the first one signs, all of them verify).