Launch offer for the first 500 accounts: $10K MTR free for 24 months + $100 credit →
    .io

    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-monthly
    • onboarding-paywall
    • lifetime-unlock
    • pro-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 sub claim.
    • Customer — what that user owns. Entitlements, purchases, analytics. The cus claim, and the same record your app_user_id resolves 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:

    We use cookies and process your data to provide our services. By continuing, you agree to our Terms and Privacy Policy.