1. Architecture & How It Works
Devlio features a built-in, native licensing engine designed specifically for creators. Every project you publish has its own isolated licensing system, completely independent from other projects.
Automatic Issuance on Purchase
When a customer buys your software via card (Polar) or local payment (Asiacell), Devlio automatically generates a unique license key formatted with your custom prefix (e.g. MYAPP-XXXX-XXXX-XXXX).
Software Activation
The buyer inputs their key into your application or installer. Your code calls the Devlio Activation API with the key and their domain/machine ID.
Domain & Hardware Enforcement
Devlio verifies that the license is active and hasn’t exceeded the maximum allowed domains/activations you configured. If valid, the domain is recorded and activation is confirmed.
Periodic Heartbeat
Your software periodically sends a heartbeat request to check for revocations, suspensions, or expiration dates, keeping your software secure.
2. Enabling Licensing in Creator Studio
You can configure the licensing system for any of your projects in seconds:
- Go to My Projects in your dashboard.
- Click on Licenses next to your project.
- Toggle the switch: Enable Built-in Licensing for this Project.
- Configure your rules:
- Key Prefix: Customize the beginning of issued keys (e.g. <code>PLUGIN</code> or <code>CMS</code>).
- Max Activations: Maximum number of distinct domains/machines allowed per key (default is 1).
- Domain Matching: Enforce that each activation binds to a specific domain name or hostname.
- Machine / HWID Lock: Lock the license to specific hardware signatures for desktop or CLI tools.
Per-Project Code Snippets: Your project’s Licenses page contains pre-filled, ready-to-copy code snippets tailored with your exact project slug and settings.
3. REST API Reference
All API endpoints accept JSON or form-encoded POST requests with no authentication token required from the client software (the license key itself acts as authentication):
A. Activate License
POST https://devlio.store/api/v1/licenses/activate
Call this when the buyer first installs your software or enters their license key.
| Field | Type | Description |
|---|---|---|
license_key |
string (required) | The key provided by the buyer (e.g. DEV-XXXX-XXXX-XXXX). |
project_slug |
string (required) | Your project slug on Devlio (e.g. your-project-name). |
domain |
string (optional) | The buyer’s website domain (e.g. example.com or localhost). |
hwid |
string (optional) | Hardware or machine ID for desktop software. |
instance_name |
string (optional) | Friendly label for this installation (e.g. Production Server). |
Success Response (201 Created / 200 OK):
{
"success": true,
"message": "License successfully activated for this instance.",
"license": {
"license_key": "DEV-ABCD-EFGH-1234",
"status": "active",
"is_valid": true,
"max_activations": 1,
"activations_count": 1,
"expires_at": null,
"license_type": "lifetime"
}
}
Activation Limit Exceeded Error (400 Bad Request):
{
"success": false,
"error": "ACTIVATION_LIMIT_REACHED",
"message": "Activation limit reached (1/1). Please deactivate an existing instance or reset bindings in Creator Studio.",
"max_activations": 1,
"active_activations": 1
}
B. Verify License / Periodic Heartbeat
POST https://devlio.store/api/v1/licenses/verify or GET
Call this on startup or once every 24 hours to confirm the license is still active and update the last ping timestamp.
{
"success": true,
"valid": true,
"status": "active",
"project": {
"title": "Your Project Title",
"slug": "your-project-slug"
},
"license": {
"key": "DEV-ABCD-EFGH-1234",
"type": "lifetime",
"expires_at": null,
"max_activations": 2,
"active_activations": 1,
"is_activated_here": true
}
}
C. Deactivate Instance
POST https://devlio.store/api/v1/licenses/deactivate
Frees up the domain/machine slot when a customer uninstalls your software so they can move it to a new server.
{
"license_key": "DEV-ABCD-EFGH-1234",
"domain": "old-domain.com"
}
4. Ready-to-Use Code Examples
PHP / WordPress Implementation
Drop this class into your PHP script or WordPress plugin. It includes automatic 24-hour result caching using local storage or transients so your site remains fast.
<?php
class DevlioLicense {
const API_URL = 'https://devlio.store/api/v1/licenses';
const PROJECT_SLUG = 'YOUR-PROJECT-SLUG'; // Replace with your slug
/**
* Verify license with local caching (24 hours).
*/
public static function check($licenseKey, $domain = null) {
$domain = $domain ?: ($_SERVER['SERVER_NAME'] ?? 'localhost');
$cacheFile = sys_get_temp_dir() . '/devlio_lic_' . md5($licenseKey . $domain) . '.json';
// Check cache to avoid hitting API on every page load
if (file_exists($cacheFile) && (time() - filemtime($cacheFile) < 86400)) {
$cached = json_decode(file_get_contents($cacheFile), true);
if (!empty($cached['valid'])) {
return true;
}
}
// Call Devlio API
$response = self::request('/verify', [
'license_key' => trim($licenseKey),
'project_slug' => self::PROJECT_SLUG,
'domain' => $domain
]);
if (!empty($response['valid'])) {
file_put_contents($cacheFile, json_encode(['valid' => true, 'time' => time()]));
return true;
}
return false;
}
/**
* Activate software on a new domain.
*/
public static function activate($licenseKey, $domain = null) {
$domain = $domain ?: ($_SERVER['SERVER_NAME'] ?? 'localhost');
return self::request('/activate', [
'license_key' => trim($licenseKey),
'project_slug' => self::PROJECT_SLUG,
'domain' => $domain
]);
}
private static function request($endpoint, array $data) {
$ch = curl_init(self::API_URL . $endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_TIMEOUT, 6);
$res = curl_exec($ch);
curl_close($ch);
return $res ? json_decode($res, true) : null;
}
}
?>
Python Implementation (Apps, CLI, Web Services)
Official Python SDK Available: You can verify licenses with 1 line of code using devlio on PyPI: pip install devlio
# Method A: Using the official SDK (Recommended)
from devlio import LicenseClient
lic_client = LicenseClient(project_slug="YOUR-PROJECT-SLUG")
check = lic_client.verify("DEV-XXXX-XXXX-XXXX")
if check.valid:
print("License active! Max activations:", check.max_activations)
# Method B: Direct HTTP requests without external dependencies
import requests
import socket
API_BASE = "https://devlio.store/api/v1/licenses"
PROJECT_SLUG = "YOUR-PROJECT-SLUG"
class DevlioLicense:
@staticmethod
def verify(license_key, domain=None):
domain = domain or socket.gethostname()
try:
resp = requests.post(
f"{API_BASE}/verify",
json={"license_key": license_key, "project_slug": PROJECT_SLUG, "domain": domain},
timeout=6
)
if resp.status_code == 200:
return resp.json().get("valid", False)
return False
except Exception:
return False
@staticmethod
def activate(license_key, domain=None):
domain = domain or socket.gethostname()
resp = requests.post(
f"{API_BASE}/activate",
json={"license_key": license_key, "project_slug": PROJECT_SLUG, "domain": domain},
timeout=6
)
return resp.json()
JavaScript / Node.js Implementation
Official Node.js SDK Available: Install the official SDK from npm: npm install devlio-sdk
// Method A: Using the official Node.js SDK (Recommended)
const { LicenseClient } = require('devlio-sdk');
const licClient = new LicenseClient({ projectSlug: 'YOUR-PROJECT-SLUG' });
async function verify() {
const check = await licClient.verify('DEV-XXXX-XXXX-XXXX');
if (check.valid) {
console.log('License active!');
}
}
// Method B: Direct fetch / HTTP
const API_BASE = 'https://devlio.store/api/v1/licenses';
const PROJECT_SLUG = 'YOUR-PROJECT-SLUG';
async function checkLicense(licenseKey, domain = 'localhost') {
try {
const res = await fetch(`${API_BASE}/verify`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ license_key: licenseKey, project_slug: PROJECT_SLUG, domain })
});
if (!res.ok) return false;
const data = await res.json();
return data.valid === true;
} catch (err) {
return false;
}
}
async function activateLicense(licenseKey, domain = 'localhost') {
const res = await fetch(`${API_BASE}/activate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ license_key: licenseKey, project_slug: PROJECT_SLUG, domain })
});
return await res.json();
}
C# / .NET Implementation (Desktop Apps & Unity)
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class DevlioLicenseChecker
{
private static readonly HttpClient client = new HttpClient();
private const string ApiBase = "https://devlio.store/api/v1/licenses";
private const string ProjectSlug = "YOUR-PROJECT-SLUG";
public static async Task<bool> VerifyAsync(string licenseKey, string hwid = null)
{
hwid = hwid ?? Environment.MachineName;
var payload = new { license_key = licenseKey, project_slug = ProjectSlug, hwid = hwid };
var json = JsonSerializer.Serialize(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");
try
{
var res = await client.PostAsync($"{ApiBase}/verify", content);
if (!res.IsSuccessStatusCode) return false;
var body = await res.Content.ReadAsStringAsync();
using var doc = JsonDocument.Parse(body);
return doc.RootElement.GetProperty("valid").GetBoolean();
}
catch
{
// Network fallback or grace period
return false;
}
}
}
5. Best Practices & Security Guidelines
- Cache Verification Results: Never check the license API on every single HTTP request. Cache the positive verification result in a local file, session, or database transient for 12 to 24 hours.
- Graceful Network Fallback: If the customer’s server experiences a temporary internet outage or connection timeout, allow a 48-hour grace period before locking the software.
- Self-Service Transfers for Buyers: Let your customers know that they can unbind their license from an old domain and re-activate it on a new one directly from their Devlio dashboard (My Licenses).
- Public Key Verifier: Direct buyers or partners to Devlio Public License Checker to verify key authenticity without needing access to code or logs.
Code Obfuscation / Compilation: For maximum security, consider obfuscating PHP code (IonCube / SourceGuardian) or compiling Python/Node.js/C# executables to prevent unauthorized removal of the verification logic.