Examples

Quick Start Examples

Copy-ready example snippets showing increasing levels of usage: Minimal → Basic Server → Plugin → Browser → Advanced Sync.

Quick Start — Minimal

Shortest path: issue a device JWT using `@epheme/core` primitives.

Basic Server

Wire up the Hub device routes, `DeviceStore`, and `CertManager` for device auth.

Plugin Example

How to author a minimal backend plugin and register for Hub events.

Middleware — Device Auth

Protecting routes with `requireDevice()` and `requireAdmin()` middleware; includes role-based access control.

Logger — Structured Logging

Using `createLogger` for privacy-safe structured logging with automatic redaction of sensitive fields.

Server Utilities

Coverage for `mailer.js`, `metrics.js`, and `rateLimiter.js` with practical API usage.

Browser Quick Start

Using `DeviceSession` and `quickConnectClient` from the browser to pair and call protected endpoints.

Browser SDK — Full Usage

Covers `client`, `device`, `hub-sync`, `license`, `idb`, and plugin-registry browser modules.

Advanced — Sync

Example showing Sovereign Sync server and client delta flow.

Coverage Map

File-by-file map showing where every package source file is covered in docs/examples.