Types
X511Config
Configuration object passed to x511().
ts
interface X511Config {
domain: string
basePath?: string
providers: ('self' | 'zkpassport')[]
disclousures: {
minAge: number
}
}Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
domain | string | Yes | - | Public base URL of the server, e.g. 'https://example.com'. No trailing slash. Used to build provider callback URLs and QR code links. |
basePath | string | No | '/' | Route prefix for X511's internal endpoints (/sse, /verify/self, /verify/zk). |
providers | ('self' | 'zkpassport')[] | Yes | - | Which providers are shown on the verification page. |
disclousures.minAge | number | Yes | - | Minimum age the user must prove (e.g. 18). Passed to provider SDKs. |
VerificationState
Union type returned by gate.verified(req).
ts
type VerificationState =
| {
type: 'pending'
config: X511Config
sessionId: string
providersPayload: ProvidersPayload
}
| { type: 'verified' }Variants
{ type: 'pending' }
The request does not have a valid access token. Includes everything the verification page needs:
| Field | Type | Description |
|---|---|---|
config | X511Config | The resolved configuration (with basePath defaulted) |
sessionId | string | UUID for this session, used by SSE and provider callbacks |
providersPayload | ProvidersPayload | Provider-specific data for rendering the page |
{ type: 'verified' }
The request carries a valid session_id + access_token pair. The session is consumed immediately - re-using the same token will not succeed.
ProvidersPayload
Per-provider data embedded in the 511 HTML page.
ts
type ProvidersPayload = Partial<{
self: { link: string }
zkpassport: { domain: string }
}>Fields
| Field | Type | Description |
|---|---|---|
self.link | string | Universal link for the Self mobile app (encodes the ZK proof request). Used to generate the QR code on the client. |
zkpassport.domain | string | Server domain passed to the ZKPassport SDK running in the browser. The SDK uses this to build its own QR code client-side. |
Only the keys for enabled providers are present. For example, if providers: ['self'], then ProvidersPayload will only have the self key.