Skip to main content
Jaza uses two long-lived keys plus a short-lived client session from your host handshake. Top-up JWTs are minted by the client SDK from that session — you do not pass them through onRequestToken on the happy path.

Keys

Backend

Frontend

Pass the publishable key into JazaProvider:
Never embed the secret key in a mobile app, web frontend, or public repository.

Client session JWT

jaza.init({ customerId }) returns an InitResult with sessionToken. Your app loads it via JazaProvider getSession (or authEndpoint). The client SDK then calls Jaza client routes with:
  • X-Jaza-Public-Key: <publishable key>
  • Authorization: Bearer <session JWT>
See Handshake.

Top-up JWT (internal)

After a session exists, the SDK mints a short-lived top-up JWT via POST /v1/client/top-ups when the user opens checkout. Apps do not implement onRequestToken for the primary flow.

Advanced / legacy

jaza.topUp({ customerId }) on the Node SDK still returns a host-minted top-up JWT for older integrations. Prefer the client-session path above.

Webhook secrets

Endpoint signing secrets (whsec_…) are separate from API keys. Store them only on the server and verify with jaza.webhooks.constructEvent. See Webhooks.

Environments

Sandbox and live are isolated (keys, wallets, top-ups, webhooks, customers). Use test keys until the flow is solid, then switch to live keys from the dashboard.

Going live: remint customerId

A cus_… created with jz_test_* keys does not exist under jz_live_*. jaza.init / getCustomer return 404 Customer not found. Balances and ledger do not carry over. Your host app owns the mapping. Typical pattern when a stored id is missing in the current environment:
  1. Detect 404 on getCustomer / init (or compare stored env vs current key prefix).
  2. Call createCustomer with the same email/phone against the live secret key.
  3. Overwrite the user’s customerId in your database.
  4. Call jaza.init with the new id.
On the client, handle handshake failure via onAuthError(error) and show authError from useJaza(). Navigate away before clearing session so screens that call useJaza are not left outside JazaProvider.

Next steps