Setup

Configuration

Create a Publishable API Key from your Bridge Dashboard. These are not masked in the UI, and have a green check next to them.

createBridgeClient

Call createBridgeClient once and reuse the client. The config matches BridgeSdkConfig from @usebridge/sdk-core:

1import { createBridgeClient } from "@usebridge/sdk";
2import { consoleLogger } from "@usebridge/sdk-core";
3
4const bridge = createBridgeClient({
5 publishableKey: "pk_...",
6 environment: "production", // or "sandbox"
7 logger: consoleLogger, // optional
8});

To use sandbox, set environment: "sandbox".

To attach your own logger, implement the Logger interface from @usebridge/sdk-core. Alternatively, use consoleLogger for debugging.

Usage

1const payers = await bridge.searchPayers({ query: "Aetna", limit: 10 });
2
3const result = await bridge.softEligibility({
4 serviceTypeIds: ["svt_xxx"],
5 payerId: "pyr_xxx",
6 state: "CA",
7});