Skip to main content
Your server can ask Bankroll to send a notification with your app’s name on the title. Tapping it opens a path on your app’s origin. Notifications require a Bankroll-signed manifest with a truthy capabilities.push and an attested signing key. See configuration and compatibility.

Methods

Both return Promise<void>, resolving when Bankroll accepts the request for delivery. This is not confirmation that a device displayed it. notifyUser targets one Bankroll user; notifyAudience targets your configured recent-user audience. Bankroll applies your app’s audience and mute policies.

Authentication

With BANKROLL_APP_KEY, the SDK sends a shared app JWT in the Authorization header and an application/json body: path is optional. The authenticated token supplies the origin. BANKROLL_API_URL overrides the default API origin. With only BANKROLL_PUSH_KEY, the SDK preserves the legacy application/jwt request body, without an Authorization header. These JWTs use alg: EdDSA, iss: <app-origin>, aud: bankroll-push, and a 60-second SDK lifetime. The type is bankroll-push+jwt for unicast or bankroll-push-broadcast+jwt for broadcast; content is in title, body, and optional path, with the unicast recipient in sub. A legacy token does not grant general app access.

Errors

A refused request throws PushError; its code is Bankroll’s reason: Configuration and network failures can throw other errors. The SDK does not retry sends automatically; a lost reply may hide an accepted notification, so retrying can send it twice.