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.

Declare it

A hosted app, one made with bankroll apps create or in the Bankroll app, declares notifications in bankroll-app.json at the root of its repo:
bankroll-app.json
The next push to main signs it into the test version’s manifest, and the next publish into the live one; no request to Bankroll is needed. The value is consent, nothing else: whom your notifications reach is still bounded to your app’s recent users, and Bankroll can mute an app. An app made before app keys existed gets its key at that build. Any value other than true declares nothing. A self-hosted app declares it in its manifest route, push: () => true on manifestRoute, and asks for the manifest to be signed, as on Bankroll Verified.

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.