Appearance
API Quick Start
Add license validation to any app — Laravel, Node.js, Python, Go, or custom platforms.
PackEdge provides SDKs and REST APIs to validate licenses, track usage, and collect feedback.
Choose Your Integration
| Method | Package | Best For |
|---|---|---|
| JS SDK | packedge | Frontend, browser apps |
| PHP SDK | packedge-sdk/license | PHP backends |
| REST API | — | Any language, custom needs |
WordPress?
If you're building a WordPress plugin, see WordPress Quick Start for the fastest path.
1. Create Your Product
- Log into the PackEdge Console
- Go to Products → New Product
- Enter your product name and type
- Note your
public_key— you'll need it
2. Generate a License
- Go to Licenses → New License
- Select your product
- Enter customer email
- Set seats and expiration
- Note the generated license key
3. Validate a License
bash
curl -X POST https://api.packedge.dev/public/v1/licenses/validate \
-H "Content-Type: application/json" \
-d '{
"public_key": "pk_your_public_key",
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX"
}'Response:
json
{
"valid": true,
"license": {
"key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"status": "active",
"seats": 5,
"activatedCount": 0,
"expiresAt": "2027-02-06T00:00:00.000Z"
}
}4. Activate a License
bash
curl -X POST https://api.packedge.dev/public/v1/licenses/activate \
-H "Content-Type: application/json" \
-d '{
"public_key": "pk_your_public_key",
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"domain": "https://customer-site.com"
}'Response:
json
{
"success": true,
"activation_id": "act_xxx",
"activated_at": "2026-02-06T12:00:00.000Z"
}5. Check Activation
bash
curl -X POST https://api.packedge.dev/public/v1/licenses/check \
-H "Content-Type: application/json" \
-d '{
"public_key": "pk_your_public_key",
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"domain": "https://customer-site.com"
}'Response:
json
{
"activated": true,
"activation_id": "act_xxx"
}6. Deactivate
bash
curl -X POST https://api.packedge.dev/public/v1/licenses/deactivate \
-H "Content-Type: application/json" \
-d '{
"public_key": "pk_your_public_key",
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"domain": "https://customer-site.com"
}'Code Examples
JS SDK (Recommended for Frontend)
bash
pnpm add packedgebash
npm install packedgebash
yarn add packedgebash
bun add packedgejavascript
import packedge from 'packedge';
packedge.init('pk_your_public_key');
// Validate (site auto-detected)
const result = await packedge.validateLicense(licenseKey);
if (result.valid) {
console.log('License active until', result.license.expiresAt);
}
// Activate
await packedge.activateLicense(licenseKey);
// Track usage
packedge.track('feature_used', { feature: 'export' });Or via CDN (non-WordPress):
html
<script src="https://cdn.packedge.dev/packedge.js"></script>PHP SDK (Recommended for Backends)
bash
composer require packedge-sdk/license
composer require packedge-sdk/analyticsphp
use PackEdge\License;
use PackEdge\Analytics;
// License validation
$license = License::init('pk_your_public_key', __FILE__);
if ($license->is_valid()) {
echo 'License is active';
}
// Auto-updates
$license->updater();
// Track usage (separate package)
$analytics = Analytics::init('pk_your_public_key', __FILE__);
$analytics->track('feature_used', ['feature' => 'export']);REST API (Any Language)
javascript
// JavaScript (fetch)
async function validateLicense(licenseKey) {
const response = await fetch('https://api.packedge.dev/public/v1/licenses/validate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
public_key: 'pk_your_public_key',
license_key: licenseKey,
}),
});
return response.json();
}python
# Python
import requests
def validate_license(license_key):
response = requests.post(
'https://api.packedge.dev/public/v1/licenses/validate',
json={
'public_key': 'pk_your_public_key',
'license_key': license_key,
}
)
return response.json()go
// Go
func validateLicense(licenseKey string) (map[string]interface{}, error) {
body, _ := json.Marshal(map[string]string{
"public_key": "pk_your_public_key",
"license_key": licenseKey,
})
resp, err := http.Post(
"https://api.packedge.dev/public/v1/licenses/validate",
"application/json",
bytes.NewBuffer(body),
)
// ...
}Error Handling
All endpoints return error details in the response:
json
{
"valid": false,
"error": "License has expired"
}Common errors:
| Error | Meaning |
|---|---|
Invalid public_key | Check your public key |
License key not found | Invalid license key |
License has expired | License past expiration date |
License is suspended | License manually suspended |
License seat limit reached | No available seats |
