Integration Guide
The LVS Agent runs on your Linux server and sits between your application and the License Verification Server. Your code makes a single local HTTP call to check whether a user is licensed — the agent handles all LVS communication, 24-hour offline caching, and automatic grant refresh. Integration takes three steps.
nginx · Drupal
grant cache + offline
Ed25519 signed tokens
The agent binds to 127.0.0.1 only — it is never exposed to the network.
Get your license key
Your license key identifies your account to the LVS Agent and tells it which user grants to enforce. Find it in your portal under Licenses.
- Sign up for a free account (or sign in)
- Navigate to Licenses in the left sidebar.
- Find or create the license for your site — copy the key.
Install the agent
Run this one command on your Linux server as root. The installer detects your distro, creates a dedicated service account, starts the agent, and prints a local token you'll need in the next step.
The installer will prompt for:
- Your LVS server URL
https://www.licenseverificationserver.com(default, press Enter) - Your license key from Step 1
- Port for the local API (default 8788, press Enter)
The installer will automatically:
- Create a dedicated
lvs-agentsystem user (no shell, no home directory) - Install and enable the agent as a systemd service
- Generate a secret local token — save it immediately
⚑ Save your local token
After installation completes, the installer prints your
LVS_LOCAL_TOKEN. This token authenticates your app
to the agent — without it, any process on the server could consume
your licensed seats.
Add it to your app's environment now:
The token is stored in /opt/lvs-agent/config.json (mode 600)
if you ever need to retrieve it.
Verify the agent is running:
Check authorization in your code
Call the agent before serving any licensed content. It returns a JSON
response with a status field — check for
"granted". If the agent is unreachable, all examples
fail closed.
Gate an entire URL path without touching application code. The
auth_request module reads the HTTP status from the agent —
200 allows, 403 denies.
YOUR_LOCAL_TOKEN with the token from Step 2.
After editing, run nginx -t && systemctl reload nginx.
Agent response reference
| Status | JSON body | Meaning |
|---|---|---|
| 200 | {"status":"granted","cached":true,"expires_at":"…"} |
User is licensed — grant access |
| 403 | {"status":"rejected","reason":"license_limit_reached","used":N,"limit":N} |
Over user limit — show upgrade prompt |
| 503 | {"status":"error","reason":"lvs_unreachable"} |
Agent can't reach LVS; still uses the 24-hour offline cache if a prior grant exists |
Revoking a user
When a user's subscription ends or they're removed from your system, revoke their grant so the seat is freed. The agent clears its local cache and notifies LVS.
Running Drupal?
The LVS License Service Drupal module handles all of this automatically — no agent installation needed. It gates node access and user roles by license level, integrates with Drupal's permission system, and caches grants in Drupal's cache API.
View the Drupal module on GitHub →Removing the Agent
The LVS Agent can be removed from your server at any time. Once removed,
the agent's local HTTP API is no longer available and license restrictions
are no longer enforced — all users will have unrestricted access to your
application. Before removing, update your application code to remove calls
to the local /authorize
endpoint (or change your logic to allow all users).
Option 1 — Automated uninstall
Run the bundled uninstall script as root. It stops the service, removes all installed files, and cleans up the systemd unit in one step.
Option 2 — Manual removal
Run each command in order:
sudo systemctl stop lvs-agentsudo systemctl disable lvs-agentsudo rm -rf /opt/lvs-agentsudo rm -f /etc/systemd/system/lvs-agent.servicesudo systemctl daemon-reload- (Optional)
sudo rm -f /var/log/lvs-agent.log
http://127.0.0.1:8788/authorize will receive a connection-refused
error. Remove those calls or replace them with unconditional access before
uninstalling.
Frequently asked questions
Authorization: Bearer … header or
using the wrong token. Verify LVS_LOCAL_TOKEN matches the value in
/opt/lvs-agent/config.json. You can check with:
which python3 should be
/usr/bin/python3), permission error on the config file,
or port 8788 already in use.
503 response. This window is
configurable via offline_grace_seconds in
/opt/lvs-agent/config.json.
|| true suppresses that).
Your config.json is preserved because the installer only
overwrites agent.py and the systemd unit, not the config.
127.0.0.1 only. Your site backend and nginx are the only
callers; both run on the same server. Never proxy the agent port through
a firewall or nginx externally — the internal; directive on
the /lvs-auth location enforces this for nginx.
Need the full REST API? View the API Reference → · Contact us