API Reference — @tuwaio/siwx (CAIP-122 Authentication Layer)
SiwxVerificationPolicy
Defined in: packages/siwx-core/dist/index.d.ts:88
Policy parameters for server-side CAIP-122 message verification. Enforces strict security constraints including domain, URI, chain ID, and timing windows.
Properties
allowedChainIds?
optionalallowedChainIds?:string[]
Defined in: packages/siwx-core/dist/index.d.ts:100
List of allowed CAIP-2 chain IDs (e.g. [“eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpK”]).
clockSkewSeconds?
optionalclockSkewSeconds?:number
Defined in: packages/siwx-core/dist/index.d.ts:120
Allowed clock skew in seconds when validating timestamps.
Default
60 (1 minute)enforceNotBefore?
optionalenforceNotBefore?:boolean
Defined in: packages/siwx-core/dist/index.d.ts:125
Whether to enforce the notBefore timestamp if present in the message.
Default
trueexpectedDomain?
optionalexpectedDomain?:string|string[]
Defined in: packages/siwx-core/dist/index.d.ts:92
Expected domain(s) requesting sign-in (e.g. “tuwa.io” or [“tuwa.io”, “staging.tuwa.io”]).
expectedUri?
optionalexpectedUri?:string|string[]
Defined in: packages/siwx-core/dist/index.d.ts:96
Expected RFC 3986 URI(s) subject of sign-in (e.g. “https://tuwa.io ”).
maxIssuedAtAgeSeconds?
optionalmaxIssuedAtAgeSeconds?:number
Defined in: packages/siwx-core/dist/index.d.ts:111
Maximum allowed age of the message’s issuedAt in seconds.
Prevents accepting stale sign-in messages.
Default
300 (5 minutes)maxSessionLifetimeSeconds?
optionalmaxSessionLifetimeSeconds?:number
Defined in: packages/siwx-core/dist/index.d.ts:115
Maximum allowed session lifetime in seconds (expirationTime - issuedAt).
requireExpirationTime?
optionalrequireExpirationTime?:boolean
Defined in: packages/siwx-core/dist/index.d.ts:105
Whether the CAIP-122 message MUST include an expirationTime.
Strongly recommended for zero-infrastructure stateless demo profiles.