πŸ“œLicense Types & Lifecycle

Licenses are the heart of DevPayr. They decide who can use your software, where they can use it, and for how long. Understanding how licenses work β€” from creation β†’ validation β†’ expiration β†’ renewal β€” helps you build strong, predictable licensing flows for your app, SaaS, plugin, or client project.

This page breaks down:

  • The two license types in DevPayr

  • How licenses behave over time

  • What happens during validation

  • How domain limits and usage tracking work

  • What renewals, reactivation, and suspension mean

  • How test licenses differ from production licenses

  • Full lifecycle flow of a DevPayr license

And we’ll do it in a way that feels human and not like a legal document from 1998. Let’s go. πŸš€

πŸ” License Types in DevPayr

DevPayr supports two license types, each built for a different purpose:

1. Production Licenses

These are the licenses your customers will actually use in real environments.

Designed for:

  • Live websites

  • Deployed applications

  • Client projects in production

  • Paid SaaS subscribers

  • Digital products installed on real domains

Key characteristics

  • Strict validation β€” domain/IP/country rules apply.

  • Counts toward usage limits.

  • Cannot be used on test/staging/dev domains.

  • Eligible for injectables only-if-paid rules.

  • Can be associated with allowed domains (if domain restriction is set).

These are the licenses that bring in the money. πŸ’°

2. Test Licenses

These help you (and your team) build, debug, and test your app without triggering production rules.

Designed for:

  • Local development

  • QA servers

  • Staging environments

  • CI/CD builds

  • Running internal tests

Key characteristics

  • Relaxed domain rules β€” works on localhost, 127.0.0.1, and *.test domains.

  • Not allowed on production domains (as a safety feature).

  • Useful for developers working on multiple machines.

  • Does not interfere with production usage metrics.

This keeps your development flow smooth without messing with real customer data.

πŸ“¦ Optional License Configuration

When creating a license, DevPayr gives you high-precision controls over how the license behaves.

These are optional but incredibly powerful:

πŸ”Ή Domain Restrictions

You can configure the license to:

A. Bind to a specific domain

If you select a domain while issuing the license: ➑ Only that domain may use it.

Use this when delivering client projects and you want to lock the license to their approved domain.

B. Allow multiple domains

If you do not select a domain: ➑ The license follows your domain limits (Max Domains / Max Subdomains).

Perfect for products that support multiple installations.

πŸ”Ή Max Domains

Controls how many unique domains this license can run on.

Example:

  • A license with Max Domains = 3 can be used on: site1.com, site2.com, site3.com β€” and that’s it.

πŸ”Ή Max Subdomains

Controls how many subdomains per domain.

Example:

  • For example.com, if Max Subdomains = 2 β†’ allowed:

Any more than that? ❌ Blocked.

πŸ”Ή Max Usage per Day

This rate-limits how many times a license can be validated per 24 hours.

Useful for:

  • Trials

  • Limited-access apps

  • Low-cost tiers

  • APIs where you want to throttle usage

It prevents a single license from being used in… let’s say enthusiastic ways.

πŸ”Ή Expiration Date

Every license can optionally expire.

Used for:

  • Trials

  • Subscription renewals

  • Time-limited contracts

  • Licensing behaviour tied to billing cycles

A license with no expiration date = lifetime license.

πŸ”Ή Custom Metadata

Your license can carry any custom key:value metadata you want.

Great for:

  • Client IDs

  • Billing references

  • Internal identifiers

  • Tier information

  • Notes about customer or package

Metadata automatically appears in:

  • SDK responses

  • API responses

  • Webhook payloads

πŸ”„ License Lifecycle

A DevPayr license moves through several clear stages. Each stage affects what the app is allowed to do.

Here’s the full lifecycle:

1. Created

A license is issued inside a project. At this point, DevPayr assigns it:

  • A license key

  • Domain rules

  • Usage limits

  • Metadata

  • Test/Production type

The license exists β€” but whether it can run depends on validation.

2. Active

The license is valid, not expired, not revoked, and within allowed domain/usage rules.

This is its β€œnormal working” mode.

Apps using the SDK will receive responses like:

3. Validating (Runtime Stage)

Each time your app runs DevPayr’s validation:

DevPayr checks:

  • Is the license legitimate?

  • Is it expired?

  • Is the domain allowed?

  • Is the license test or production?

  • If test β†’ is this a test-compatible domain?

  • Is usage limit exceeded?

  • If restricted to a domain β†’ does it match?

  • Should injectables be returned?

  • Has the domain been marked "paid" by the developer?

If everything passes β†’ App continues running If anything fails β†’ DevPayr uses your chosen invalidBehavior:

  • modal

  • redirect

  • silent

  • log

4. Usage Tracking

Each validation increments the license’s daily usage counter (if configured).

DevPayr prevents usage overflow and returns a helpful error if usage limits are exceeded.

5. Expired

Once past the expiration date:

  • License immediately becomes invalid

  • SDK triggers invalid behavior

  • API returns an expiry-specific error

Renewing or extending the expiration revitalizes the license instantly.

6. Revoked

If you suspend a license:

  • It cannot validate

  • It ignores domain rules

  • It becomes fully disabled

SDK receives a β€œrevoked” status.

Reactivation restores it.

7. Reactivated

If you choose Reactivate:

  • License becomes valid again

  • Domain rules apply again

  • SDK resumes normal operation

Useful for restoring access after a payment or contract renewal.

πŸ“Š Domain Matching & Environment Logic

DevPayr enforces domain rules intelligently:

  • Production licenses β†’ must run on production domains

  • Test licenses β†’ must run on dev/test/local domains

If a user tries to use a test license in production β†’ blocked If a user tries to use a production license on test domains β†’ also blocked

This ensures:

  • Your product isn’t launched in production using a dev license

  • Your developers aren’t blocked while testing

πŸ—‚ License Types Summary

License Type
Where It Works
Restrictions
Ideal For

Production License

Live domains

Strict domain/IP/usage rules

Real customers

Test License

localhost, 127.0.0.1, *.test

Cannot run in production

Developers, CI, staging

🧠 Why This Matters

Licensing is not just about blocking unauthorized use β€” it's about flexibility, security, and control.

With DevPayr:

  • You can sell in multiple tiers

  • You can limit or expand features via injectables

  • You can automate billing-driven license changes

  • You can differentiate between dev and live environments

  • You can fully control how your product is used

DevPayr gives you the structure needed to scale your licensing professionally β€” without losing your sanity.

Last updated