UNPKG

@flipt-io/vercel-adapter

Version:
33 lines (30 loc) 1.09 kB
import { FliptClient } from '@flipt-io/flipt-client-js'; import { Adapter, ProviderData } from 'flags'; interface FliptConfig { url?: string; namespace?: string; authentication?: { clientToken: string; }; updateInterval?: number; } type EvaluationContext = { id: string; [key: string]: unknown; }; type AdapterFunction<O> = <T>(getValue: (obj: O) => T, opts?: object | undefined) => Adapter<T, EvaluationContext>; type AdapterResponse = { boolean: AdapterFunction<{ enabled: boolean; }>; variant: AdapterFunction<{ variantKey: string; attachment?: string; }>; initialize: () => Promise<FliptClient>; }; declare function createFliptAdapter(options?: FliptConfig): AdapterResponse; declare const fliptAdapter: AdapterResponse; declare function __resetClientForTesting(): void; declare function getProviderData(options?: FliptConfig): Promise<ProviderData>; export { type AdapterResponse, type EvaluationContext, type FliptConfig, __resetClientForTesting, createFliptAdapter, fliptAdapter, getProviderData };