Validate a licence key
One POST to /apps/{appId}/licenses/authenticate. Node 18+ (global fetch). No dependencies.
const APP_ID = process.env.EVORA_APP_ID;
export async function verifyLicence(licenseKey) {
const res = await fetch(
`https://api.evora.lol/api/developer-api/apps/${APP_ID}/licenses/authenticate`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EVORA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ licenseKey }),
},
);
if (!res.ok) return { ok: false, status: res.status };
const data = await res.json();
return { ok: data.authenticated === true, subscription: data.subscription };
}
// Call this from your server only. A key in client-side JS is a public key.