Skip to main content
The React integration uses the same browser SDK with a provider and hook. The provider owns startup and cleanup, including React Strict Mode remounts.

Install

Add the provider

Create the configuration outside the component tree so React does not create a new SDK instance on every render.
Wrap your application once, as close to the root as practical.

Track a lead

In production, send the event after the signup succeeds—not merely when the button is pressed.

Available hook values

useBiqli() returns:
  • sdk: the underlying BiqliAnalytics instance
  • trackClick, trackLead, and trackSale
  • storeStripeSession for the built-in Stripe browser adapter
  • getClickId
  • setConsent
  • decorateUrl
useBiqliAnalytics is an alias of useBiqli.

Server-rendered React

Use @biqli/analytics only in client components or browser-owned code. Use @biqli/sdk in server routes, actions, jobs, and verified webhooks.
Do not construct the configuration inline during every render. A changing object causes the provider to replace its SDK instance.
The provider has been designed for React Strict Mode. It does not leave duplicate history listeners, timers, or dynamic-link handlers after cleanup.