Skip to content

Quickstart

This guide takes you from an empty account to software that checks its license. It takes about ten minutes. The examples use a desktop antivirus; substitute your own product.

  1. Create an account. Sign up free. The Free plan needs no card and covers up to 50 active clients.

  2. Create an application. In the console, open LaaSio and add an application, for example Antivirus.

  3. Add a license. Add a license to the application, for example name av-realtime, display name Real-time Protection, type Paid.

  4. Optionally add a limit. For example devices, applying to av-realtime.

  5. Create a SKU. For example code AV-ANNUAL-25: grants av-realtime, lasts 366 days, devices = 25.

  6. Assign it to a client. Add a client with ID PC-123 and give it the SKU. In production your store does this after a sale with the provisioning API.

  7. Copy your public values. In LaaSio → Settings, copy your organization ID (lzo_…) and public key. Both are safe to build into your software.

  8. Check the license from your software. Call the lookup and verify each entry’s signature. The Develop tab in the console shows the same examples with your values already filled in.

    // Node.js 18+ (built-in fetch and Ed25519), save as licenses.mjs
    import { createPublicKey, verify } from "node:crypto";
    const LAASIO_URL = "https://laasio.functual.com";
    const ORG_ID = "lzo_YOUR_ORG_ID";
    // Your organization's public key, wrapped in the standard 12-byte Ed25519 header Node expects
    const PUBLIC_KEY = createPublicKey({
    key: Buffer.concat([Buffer.from("302a300506032b6570032100", "hex"), Buffer.from("YOUR_PUBLIC_KEY_BASE64", "base64")]),
    format: "der",
    type: "spki",
    });
    // Keys sorted at every level; JSON.stringify adds no whitespace and leaves "/" and Unicode as-is
    function canonical(value) {
    if (Array.isArray(value)) return value.map(canonical);
    if (value && typeof value === "object") {
    return Object.fromEntries(Object.keys(value).sort().map((k) => [k, canonical(value[k])]));
    }
    return value;
    }
    /** Return the client's licenses whose signature is valid. */
    export async function getLicenses(clientId) {
    const url = `${LAASIO_URL}/api/v1/lookup?${new URLSearchParams({ org: ORG_ID, client: clientId })}`;
    const response = await fetch(url, { headers: { Accept: "application/json" } });
    if (!response.ok) throw new Error(`LaaSio ${response.status}`);
    const { data } = await response.json();
    return data.filter(({ key, ...signed }) =>
    signed.clientId === clientId &&
    verify(null, Buffer.from(JSON.stringify(canonical(signed))), PUBLIC_KEY, Buffer.from(key, "base64")));
    }
    /** A license is active from its start until its end (end null = never expires). */
    export function isActive(license, now = new Date()) {
    return new Date(license.start) <= now && (license.end === null || now < new Date(license.end));
    }
    const licenses = await getLicenses("PC-123");
    for (const license of licenses.filter((l) => isActive(l))) {
    console.log(license.name, license.type, license.limits);
    }

    Running it prints the client’s active licenses, for example av-realtime Paid { devices: 25 }.