Skip to content

proxyElectricShapeRequest

proxyElectricShapeRequest(request, claims, options): Promise<Response>

Defined in: packages/server/src/electric-proxy.ts:73

Proxies an Electric shape request, applying registry-driven row filters and stripping omitted columns from JSON shape-log payloads. Optionally answers CORS preflights and adds CORS headers (ElectricProxyOptions.cors) for gateway-less browser deployments.

The caller is responsible for resolving auth claims from the request. Pass claims as null for unauthenticated requests (all rows blocked).

Request

{[key: string]: unknown; app_metadata?: {[key: string]: unknown; roles?: string[]; }; sub?: string; } | null

ElectricProxyOptions

Promise<Response>