Skip to main content
Your app key (zapp_sk_...) is a server secret. Never send it to a browser or put it in your page bundle.

new ZendServer(apiKey, baseUrl?)

string
required
Your app key, from zend apps create or zend apps rotate-key.
string
default:"https://api.usezend.app"
API host. Change it only for a non-production environment.
Failed calls throw an Error with code (Zend’s error code) and status (HTTP status).

verifySession(appSession)

Exchange the appSession from zend.identity.get() for the verified user.
See Sign in with Zend.

createInteraction(params)

Create an interaction on behalf of a user who has connected your app.

getInteraction(id)

updateInteraction(id, params)

Move an interaction along. Your server can make serverOnly moves that pages can’t.

getPrize(id)

The prize and every joined player’s address and app_user_id.

resolvePrize(id, winners, amountsUsd, resolverSeedHex, correction?)

Signs the result with your resolver key and posts it. Payout happens after the dispute window unless the host cancels. See Prizes.

verifyWebhook(rawBody, header, secret, toleranceSecs?)

Returns true when x-zend-signature matches the raw body and is no older than toleranceSecs (default 300). Pass the raw body, before JSON parsing. See Webhooks.

verifyAttestation(receipt, zendPublicKeyHex)

Returns true when an attestation receipt’s hash and Zend’s signature are valid. Get the key from GET /apps/attest/key. See Attestations.

resolverKeyFromSeed(seedHex)

Returns { privateKey, publicKeyHex } for a 32-byte hex seed. publicKeyHex is the value for resolverKey in your manifest. zend apps resolver-key does this for you.

prizeResultMessage(prizeId, winners, amounts, correction?)

The exact bytes your resolver key signs, matching zend::prize::result_message. resolvePrize uses it; you only need it if you sign results somewhere else.