/** * Auth57 SDK — minimal fetch-based client. * * Works in every modern runtime: Node 18+, Deno, Bun, Cloudflare Workers, * Vercel Edge, browsers. No dependencies. * * Usage: * import { Auth57Client } from '@auth57/sdk'; * const client = new Auth57Client({ apiKey: process.env.AUTH57_API_KEY! }); * const result = await client.paLookup({ * state: 'CA', program: 'medicaid_ffs', service: 'advanced_imaging', * }); */ import { type CompareInput, type CompareResponse, type LookupOptionsResponse, type ManifestResponse, type PaLookupInput, type PaLookupResponse, type Program, type StateCode, type StateSummaryResponse, type StatesListResponse } from './types.js'; export interface Auth57ClientOptions { /** * API key — grab one at https://auth57labs.com/subscribe-api. * For demo/trial, use `fca35353-4528-4fa8-b45f-f47f541ac091` * (public demo key, 10 calls/24h per session). */ apiKey: string; /** Defaults to https://api.auth57.io */ baseUrl?: string; /** * Optional fetch implementation. Defaults to globalThis.fetch. * Override for custom timeout/retry/tracing middleware. */ fetch?: typeof fetch; /** * Request timeout in ms. Default: 10_000 (10 seconds). */ timeoutMs?: number; } export declare class Auth57Client { private readonly apiKey; private readonly baseUrl; private readonly fetchImpl; private readonly timeoutMs; constructor(options: Auth57ClientOptions); /** * Look up PA rule for a single state + program + (drug OR service). * Returns verdict, confidence, source URL, next steps. */ paLookup(input: PaLookupInput): Promise; /** * Compare PA rules across up to 10 states. Returns per-state rows + * divergence summary (e.g., "3 of 5 states require PA. CA, WA are outliers."). * Requires compare_addon on your subscription. */ compare(input: CompareInput): Promise; /** * Dataset capability descriptor: live verified rule counts, supported * states/programs/services/drugs, CMS deadlines, doc pointers. No auth * needed but the client sends the key anyway for usage tracking. */ manifest(): Promise; /** * List all 51 states with rule counts and policy flags * (non_expansion / ffs_dominant / wiser). */ states(): Promise; /** * Single-state summary with per-program PA breakdown, federal-protected * classes, and per-service / per-drug counts. */ states(state: StateCode): Promise; /** * For a given (state, program), return the drug classes and service * categories that actually have rules. Useful for filtering UI dropdowns * so users don't pick combinations with no data. No auth required. */ lookupOptions(state: StateCode, program: Program): Promise; private request; } //# sourceMappingURL=client.d.ts.map