import { Hono } from 'hono'; import { Store } from './store.js'; import { JWTManager, type SigningKeyOptions } from './jwt.js'; import { type ApiKeyMap, type WorkOSAppEnv } from './middleware/auth.js'; import type { ServicePlugin, RouteContext } from './plugin.js'; export interface ServerOptions { port?: number; /** Maximum requests per API key in each 60-second window; defaults to 1,000. */ requestsPerMinute?: number; /** * The externally reachable root at which the emulator's routes are served. Every link the * emulator mints — invitation, password reset, device verification, SSO logout — and the default * `iss` is `${baseUrl}/`, while the routes themselves are mounted at `/`. A trailing slash * is therefore dropped (it would double in every link), and a path prefix is kept as the caller's * statement that the emulator is served under it: a proxy fronting it there must strip the prefix * before forwarding, or the minted links will not resolve. Defaults to `http://localhost:{port}`. */ baseUrl?: string; apiKeys?: ApiKeyMap; /** * Base the `iss` claim is built from. Defaults to the emulator's own base URL. Pin it to the * URL your real WorkOS environment issues from, so a verifier that checks `iss` against a * constant accepts emulator tokens unchanged. * * Not the whole claim: an AuthKit access token carries `{issuer}/user_management/{client_id}`, * as production does. Only the M2M, SSO, widget and OAuth-server (`/oauth2/token`) tokens carry * the bare value. */ issuer?: string; /** Pinned RSA signing key, keeping the JWKS stable across restarts. */ signingKey?: SigningKeyOptions; } export declare function createServer(plugin: ServicePlugin, options?: ServerOptions): { app: Hono; store: Store; jwt: JWTManager; port: number; baseUrl: string; ctx: RouteContext; };