UNPKG

@c15t/node-sdk

Version:

Official Node.js SDK for c15t. Connects to the Consent Engine to read and write consent records and preferences. TypeScript-first, simple APIs, built-in auth and retries.

47 lines 1.37 kB
import { contracts } from '@c15t/backend/contracts'; import type { ContractRouterClient } from '@orpc/contract'; import type { JsonifiedClient } from '@orpc/openapi-client'; /** * Configuration options for the C15T SDK client */ export interface C15TClientOptions { /** * Base URL for the API server * @example "https://api.example.com" */ baseUrl: string; /** * Authentication token (if needed) * @example "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." */ token?: string; /** * Additional headers to include with each request */ headers?: Record<string, string>; /** * Prefix path for API endpoints * @default "/" */ prefix?: string; } /** * Creates a type-safe C15T client instance * * @param options - Configuration options for the client * @returns A fully typed client for interacting with the C15T API * * @example * ```typescript * // Create a client with authentication * const client = createC15TClient({ * baseUrl: "https://api.example.com", * token: "your-auth-token" * }); * * // Now use the client with full type safety * const response = await client.users.getProfile({ userId: "123" }); * ``` */ export declare function c15tClient(options: C15TClientOptions): JsonifiedClient<ContractRouterClient<typeof contracts>>; //# sourceMappingURL=index.d.ts.map