πBasic License Validation
Now that youβve created a project and issued your first license, itβs time for the real moment: validating that license inside your application.
This single step is what locks down your product, ensures paid users get access, blocks unauthorized copies, delivers injectables, and makes DevPayr⦠well, DevPayr.
Donβt worry β validation is simple. No complex ceremony. No mystical knowledge. Just a single call to the SDK or API, and you're done.
Letβs walk through everything properly.
π§ How License Validation Works (In Plain English)
Every time your application starts (or on whatever schedule you choose):
Your app sends the license key to DevPayr
DevPayr checks:
Is the license valid?
Has it expired?
Is the domain allowed?
Has the usage limit been exceeded?
Is the environment correct?
Is the project fully paid?
DevPayr responds with:
has_paid: true/falseinjectables (if paid)
metadata
any restrictions
If everything checks out β the app continues normally. If not β DevPayr triggers your chosen behavior (modal, redirect, log, silent).
Thatβs the entire magic.
π― Two Ways to Validate a License
There are two possible approaches:
1. License Key Only (most common)
Perfect for:
Frontend apps
Themes/plugins
Client dashboards
SaaS boot-time checks
Templates or installable software
No API key required.
2. License Key + API Key (advanced)
This unlocks:
Project management
Domain modifications
License creation/suspension
Payment checks
Injectable uploads
Admin-like access from your backend
Use this ONLY on a secure backend β never in frontend code.
π§ͺ OPTION 1 β Validate Using License Key Only
This is the simplest and most common method. Examples below for Node.js, PHP, Python, and Browser (Frontend).
π¦ Node.js Example
π PHP Example
π Python Example
π¨ Frontend Example (Highly Flexible)
The frontend SDK lets you name your config anything you want. DevPayr auto-detects it.
All of the following examples work:
π‘ Tip: The frontend SDK is intentionally flexible. You can hide it, disguise it, or embed it inside your existing JS. Great for making it harder for non-technical users to βedit outβ licensing.
π§ͺ OPTION 2 β Validate Using License Key + API Key
(Advanced, Backend Only)
When you combine an API key with your license key, DevPayr turns into a full backend client.
You can now:
Manage domains
List or create licenses
Upload injectables
Fetch project data
Check payment history
Access advanced endpoints
π Node.js Example
π‘ Tip: Think of the API key as βfull DevPayr power mode.β Only use it in secure backend servers.
π Validating via Raw HTTP (cURL)
If youβre not using an SDK (embedded systems, Go, Rust, etc.), you can validate with plain HTTP.
π Validate Using License Key Only
Endpoint:
Header Example
Body Example
π Validate Using API Key
Endpoint:
π Example Response
π§ Summary
License Key Only
Frontend, SaaS runtime checks, themes, plugins
β No
License + API Key
Backend systems, dashboards, automation
βοΈ Yes
Raw HTTP
Custom environments, servers without SDKs
Optional
π You Just Validated Your First License
At this point:
Your project is set up
Your license is issued
Validation is working
Injectables are delivered (if any)
DevPayr is officially connected to your app
Last updated