BillDog Auth
Authentication that already knows what they paid for
BillDog Auth signs your users in and issues a short-lived session token your own backend verifies offline — no network call on your request path. That token carries their entitlements in the ent claim, so gating a paid feature is a claim check rather than a round-trip to us. It is the same entitlement set the rest of BillDog resolves, which is the point: one identity, one answer about what they own.
Beta
@billdog.io/auth@1.2.0-beta.1 and billdogeng-node@1.2.0-beta.1. Never @beta: a dist-tag is a mutable pointer, and one left on an older build hands you an SDK missing the API the docs tell you to call. The native binaries that carry auth — BillDogFull / BillDogEng for iOS and io.billdog:billdog-auth for Android — are released on the native SDKs' own schedule; the platform guides name the line, and an older binary predates the module and contains none of it.Two nouns, and they are not the same
These words appear on every page, so they are worth thirty seconds now:
- A user is who signs in — credentials, sessions, second factors, organization membership. In the token this is the
subclaim. - A customer is what they own — entitlements, purchases, analytics. In the token this is the
cusclaim, and it is how you join back to the rest of your BillDog data.
One user maps to at most one customer. A person who has never signed in can still be a customer — that is an ordinary anonymous purchaser. Signing in is what attaches a credential to that record.
What you get
Password, email code, SMS code, Google, Apple, Facebook, passkeys, and enterprise SSO over SAML or OIDC.
TOTP and backup codes, optionally mandatory for the whole project.
Teams with roles, invitations and verified domains — and entitlements that members inherit.
List a person's devices, end one, or end all of them. Rotation with reuse detection is on by default.
Two ways to run it
Pick one per surface. They can coexist in the same project.
| Hosted sign-in | SDK-driven | |
|---|---|---|
| What it is | A sign-in wall you author in the Paywall Builder, served on the <name>.billdog.app address issued when you enable auth, or on a verified domain of your own | Your own UI, calling the SDK |
| Refresh token | An httpOnly cookie JavaScript cannot read | Returned to you; storing it is your decision |
| You build | Nothing — branding is the wall's | Every screen and every branch |
| Available on | Web, and any app that can open a browser | Web, iOS, Android, React Native, Expo, Flutter |
Hosted is the shorter path and the safer default, because the refresh token never reaches your JavaScript and the multi-step flows — second factor, password reset — are already built. Reach for the SDK when the sign-in screen has to be yours.
Platform support
| Platform | Package | Auth |
|---|---|---|
| Web | @billdog.io/auth | Full, including organizations and second factors |
| iOS | BillDogFull / BillDogEng | Sign-in, sessions, organizations, passkeys |
| Android | io.billdog:billdog-auth | Sign-in, sessions, organizations, passkeys |
| React Native / Expo | @billdog.io/react-native, @billdog.io/expo | Delegates to the native SDKs |
| Flutter | billdog_flutter | Delegates to the native SDKs |
| Node (server) | billdogeng-node | Token verification only — no credential handling |
| Everything else | — | Not yet. Use hosted sign-in and verify tokens on your backend |
Two things no SDK can do yet
- Delete a user's own account. Erasure runs through the operator data-subject-request flow.
- Sign up into a project with a captcha or invite-only access, from a native app. The native SDKs cannot send those tokens, so the server refuses with a 400 the app cannot explain. Use hosted sign-in for those projects.
Turning it on
Auth is off by default. Enable it in Project Settings → Auth, which is also where you set who may sign up, the password policy, session lifetimes and phone sign-in. Every endpoint refuses with 403 ACCESS_DENIED until it is on.
curl https://api.billdog.io/v1/auth-config \
-H "X-BillDog-API-Key: bd_public_live_…" \
-H "Content-Type: application/json" \
-d '{}'Auth endpoints take your public key — the same one you ship in an app. The key's prefix decides the environment, and sandbox and production identities are different people with different signing keys.
Where to next
- Quickstart — a working sign-in in about fifteen minutes.
- Sessions and tokens — what the token is, how long it lives, and where to keep it.
- Identities — email, phone and username, and the one parameter that silently breaks phone sign-in.
Was this page helpful?
Or rate this page: