New @settlekit/operator-console (Next.js 14) scaffold and its server-side libraries: typed operator API client (key sent only on private routes, envelope/error mapping), HMAC-signed owner session tokens with constant-time password check, proof view model with per-decision anchored status, policy drift rows, decision paging, bill form validation, attempt limiter, and the connect-your-business onboarding over the existing API. Tests include an onboarding run against the real API app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
504 B
TypeScript
13 lines
504 B
TypeScript
/** Server-only factory for the operator API client, keyed from env. */
|
|
import "server-only";
|
|
import { createOperatorApiClient, type OperatorApiClient } from "./api-client";
|
|
import { loadConsoleConfig, type ConsoleConfig } from "./config";
|
|
|
|
export function consoleConfig(): ConsoleConfig {
|
|
return loadConsoleConfig();
|
|
}
|
|
|
|
export function operatorApi(config: ConsoleConfig = loadConsoleConfig()): OperatorApiClient {
|
|
return createOperatorApiClient({ baseUrl: config.apiUrl, apiKey: config.apiKey });
|
|
}
|