Skip to content

Docs · SDK

Configuration

Two variables are required for signing. Everything else has a working default and only matters against a non-production registry.

Environment

LIORITH_REGISTRY_SITE_IDrequiredstringYour site id, as shown in the admin panel. Signed into every proof.
LIORITH_REGISTRY_PRIVATE_KEY_B64requiredstringThe Ed25519 private key PEM, base64-encoded. Preferred, because a PEM has line breaks and a Compose .env cannot carry them.
LIORITH_REGISTRY_PRIVATE_KEYstringThe PEM directly. Use it where your secret store handles multi-line values.
LIORITH_REGISTRY_URLstringBase URL of the human-readable site. Default https://registry.liorith.net.
LIORITH_REGISTRY_API_URLstringBase URL of the API. Default https://api.registry.liorith.net.
Reading the keyts
function privateKey(): string | undefined {
  const b64 = process.env.LIORITH_REGISTRY_PRIVATE_KEY_B64;
  if (b64) return Buffer.from(b64, 'base64').toString('utf-8');
  return process.env.LIORITH_REGISTRY_PRIVATE_KEY;
}
The private key belongs in server-side environment only. On Next.js, a name prefixed with NEXT_PUBLIC_ is inlined into the client bundle - never use that prefix here.

Per-call options

checkDomain and verifyProof take the same two options. The SDK does not read environment variables itself - pass a base URL explicitly when you point at a staging registry.

apiBasestringAPI base URL. Default https://api.registry.liorith.net.
timeoutnumberMilliseconds before the request is aborted. Default 8000.
ts
const result = await checkDomain('demo.liorith.net', {
  apiBase: process.env.LIORITH_REGISTRY_API_URL,
  timeout: 3000,
});

Badge options

apiBasestringAPI base URL for the badge’s own request.
registryBasestringSite base URL the badge links to.
theme'light' | 'dark' | 'auto'Colour scheme. auto follows prefers-color-scheme and is the default.
linkTo'check' | 'verify'Where a click goes. check (default) opens the domain’s page and never goes stale; verify opens the full proof result, but that URL expires with the proof after about two minutes.
ts
import { mountBadge } from 'liorith-registry-sdk';

// params kommen vom eigenen Server, nicht aus dem Browser.
const cleanup = mountBadge(document.getElementById('badge')!, params, {
  theme: 'dark',
});

// Beim Abbau aufrufen - bricht laufende Requests ab.
cleanup();