Skip to navigation

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.

BE CAREFUL - Do not use a secret API key in your frontend!

BridgeSdkProvider

This component must be rendered as a parent to any other Bridge components or hooks.

interface BridgeSdkConfig {
publishableKey: string
logger?: Logger
environment?: "production" | "sandbox" | string
analyticsHandler?: AnalyticsHandler
}

In your layout.tsx, wrap children in BridgeSdkProvider:

const BridgeLayoutProvider = ({ children }) => {
return (
<BridgeSdkProvider config={{ publishableKey: "pk_..." }}>
{children}
</BridgeSdkProvider>
)
}

To use sandbox, set environment: "sandbox".

To attach your own logger, implement the Logger interface or use consoleLogger (exported from the SDK package).