SiwxJwtOptions
Defined in: siwx-server/src/types.ts:351
The jwt option of createSiwxApiHandler (@tuwaio/siwx-server/next): enables GET …/token (a fresh JWT for
the session cookie) and GET …/jwks (the public keys).
Properties
audience?
optionalaudience?:string|string[]
Defined in: siwx-server/src/types.ts:365
The aud claim, when the receiving service expects one.
claims?
optionalclaims?: (record) =>Record<string,unknown> |Promise<Record<string,unknown>>
Defined in: siwx-server/src/types.ts:378
Extra claims from the session record. Reserved claims cannot be set.
Parameters
record
Returns
Record<string, unknown> | Promise<Record<string, unknown>>
issuer
issuer:
string
Defined in: siwx-server/src/types.ts:363
The iss claim: the URL of your app.
previousKeys?
optionalpreviousKeys?: readonly (SiwxPublicJwk|SiwxJwtKey)[]
Defined in: siwx-server/src/types.ts:361
Keys replaced by signingKey, published in the JWKS so that tokens they signed keep verifying until they
expire. Signing keys or public JWKs.
signingKey
signingKey:
SiwxJwtKey|Promise<SiwxJwtKey>
Defined in: siwx-server/src/types.ts:356
The key that signs the tokens, from importSiwxJwtKey. A promise is accepted, so the route file needs no
top-level await; an import error then surfaces as a 500 on the first /token or /jwks request.
subject?
optionalsubject?: (record) =>string|Promise<string>
Defined in: siwx-server/src/types.ts:376
Builds the sub claim from the session record. Defaults to the bound subjectId, otherwise the account: without
its chain for a wallet that signed with its own key, with its chain for a smart contract wallet (see
siwxJwtSubject).
Parameters
record
Returns
string | Promise<string>
ttlSeconds?
optionalttlSeconds?:number
Defined in: siwx-server/src/types.ts:370
Token lifetime in seconds, from 1 to 604800 (7 days). A token never outlives its session.
Default
600