Identifier Best Practices
Key Concept: Project Scoping
All identifiers are unique within YOUR project only. Different projects can use the same identifiers without conflict.
- Your API key determines which project's data is accessed
- Reuse identifier names across test/staging/production projects
- UUIDs are used internally; you use human-readable identifiers in SDK calls
Recommended Naming: kebab-case
✅ Good Examples
premium-monthlyonboarding-paywalllifetime-unlockpro-features
❌ Avoid
PremiumMonthly(PascalCase)prod1(too generic)p(too short)
Identifier Types & Examples
Products
premium-monthly, basic-annual-us, pro-lifetime
Offerings
default-offering, student-discount, holiday-promo-2024
Packages
monthly, annual, six-months, lifetime
Entitlements
pro-features, premium-content, unlimited-exports
Placements
onboarding, settings-screen, export-limit-reached
Requirements
- Length: 2-100 characters (recommended: 10-30)
- Allowed: Letters, numbers, spaces, underscores, hyphens, dots
- Validation: Automatic normalization and uniqueness checking
Identity Identifiers
The identifiers above name things in your catalogue. BillDog Auth adds two that name people, and they are not interchangeable:
- User — who signs in. Credentials, sessions, second factors, organization membership. Carried in a session token as the
subclaim. - Customer — what that user owns. Entitlements, purchases, analytics. The
cusclaim, and the same record yourapp_user_idresolves to.
One user maps to at most one customer. A person who has never signed in is still an ordinary customer — signing in is what attaches a credential to that record, not what creates it. See Identities & Identifiers.
Signing in does not switch the SDK’s current customer. A successful sign-in returns a customer id; you still call identify() with it before analytics, attribution and entitlement reads attach to that person.
Cross-Environment Strategy
Recommendation: Use the same identifiers across all environments (dev/staging/prod).
// Same identifier works everywhere
// API key determines the project/environment
val offering = fetchOffering("premium-monthly")This is simpler than environment-specific prefixes and matches BillDog's project isolation design.
Identity is the exception. The same identifier can name the same product in sandbox and production, but sandbox and production people are different: the same email address is two different users with two different customers, and a session token minted in one cannot verify in the other. Signing keys are scoped per environment, so this is enforced rather than conventional.
Common Mistakes
❌ Too Generic
fetchOffering("default")✅ Descriptive
fetchOffering("onboarding-trial-offer")Was this page helpful?
Or rate this page: