Liorith/Registry
SDK · LIORITH REGISTRY

Install SDK

Add proof signing to any JavaScript or TypeScript project - via hosted tarball or local file install.

External site (hosted tarball)

For sites outside the monorepo. npm downloads and extracts the tarball directly - no npm registry account needed. After install, the SDK lands as a normal directory in node_modules.

npm install https://registry.liorith.net/sdk/liorith-registry-sdk.tgz

Monorepo (local file)

For apps in the same repository. The SDK is symlinked into node_modules - changes to registry-sdk/src/ are reflected immediately after a rebuild.

npm install file:../registry-sdk

If you use Turbopack (the Next.js default dev server), add this to next.config.ts so Turbopack can resolve the symlink:

next.config.ts
import path from 'path';
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
  turbopack: { root: path.resolve(__dirname, '..') },
};

export default nextConfig;

Exports

TypeScript
import {
  signProof,     // (siteId, host, secretKey) → ProofParams
  proofToUrl,    // (params, registryBase?)   → string
  badgeUrl,      // (siteId, registryBase?)   → string
  badgeMarkdown, // (siteId, host, registryBase?) → string
} from 'liorith-registry-sdk';
signProof
Signs a proof and returns the parameters object (ProofParams) needed by proofToUrl.
proofToUrl
Converts ProofParams into a redirect URL pointing to the registry verify endpoint.
badgeUrl
Returns the URL of the SVG status badge for a given site ID.
badgeMarkdown
Returns a Markdown snippet with a linked badge image, ready to paste into a README.

CLI tool

The package ships a liorith-verify binary for testing proof signing from the terminal.

Terminal
# Sign a proof and print the redirect URL
npx liorith-verify sign \
  --site site_my-website \
  --host example.com \
  --key <secret-key>

# Verify an existing proof URL
npx liorith-verify check "https://registry.liorith.net/verify?site=..."