This is the browser-side
pk_ surface. A publishable key is safe to ship in
front-end code; a secret sk_ key is not. The server still decides whether the
key’s origin and partner are enabled.createPublishableDeposit creates a Deposit session without putting a
destination in the browser request. Supply exactly one binding artifact:
candidateId, grant, or challenge.
Candidate selection
candidateId is the no-secret, no-signature path. The merchant registers the
destination candidates server-side; the browser selects one by its opaque,
partner-scoped id. It needs no merchant backend at runtime:
orderId and candidateId. Metadata,
redirects and expiry come from the stored intent and cannot be supplied on
this path.
Payer proof
SIWE challenge
The challenge path asks the payer to sign a server-issued message. It is EVM-only. It is useful when the payer is proving control of a destination address, but it is not a free-form destination field:expiresAt. The proof contains the issued nonce
and the payer’s signature.
Server-minted grant
A grant is a single-use JWS minted by the merchant’s server. It binds the destination without exposing a secret key, but it does require a merchant backend to issue the grant:metadata, successUrl,
cancelUrl, and expiresIn (session lifetime in seconds).
Functions and types
Branchable errors
The SDK maps the first integration failures to stable error codes. Branch onHypermidError.code, not on the message. status, meta.requestId, and the
server’s original code in details.serverCode are preserved.
The SDK also rejects a key beginning with
sk_ locally, before making a
request, with a regular Error. SECRET_KEY_USED is the HypermidError code
for the corresponding 401 response when the server sees the invalid key.
orderId or a request with anything other than
one binding artifact before sending a request. A returned PaymentSession
means a session was created; determine payment status separately.