onRequestToken on the happy path.
Keys
Backend
- Node
Frontend
- React Native
- React
Pass the publishable key into
JazaProvider: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>
Top-up JWT (internal)
After a session exists, the SDK mints a short-lived top-up JWT viaPOST /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:
- Detect
404ongetCustomer/init(or compare stored env vs current key prefix). - Call
createCustomerwith the same email/phone against the live secret key. - Overwrite the user’s
customerIdin your database. - Call
jaza.initwith the new id.
onAuthError(error) and show authError from useJaza(). Navigate away before clearing session so screens that call useJaza are not left outside JazaProvider.
Next steps
- Quickstart · Handshake · Top-up · Node SDK