SDKs
npm install @finbaze/embed-react
import { FinBazeProvider, FinBazeVatReturn } from "@finbaze/embed-react";
<FinBazeProvider publishableKey="fb_pk_test_…" fetchClientSecret={fetchClientSecret} appearance={{ theme: "auto" }}>
<FinBazeVatReturn period="current" onFilingSubmitted={({ filing }) => track("vat_submitted", filing.id)} onError={console.error} />
</FinBazeProvider>
- One
<FinBazeProvider>per signed-in user. It loads the controller once and destroys it on unmount. - Every component takes its options as props and every event as an
on…prop (filing.submitted→onFilingSubmitted). - Views fill their parent: give the parent a height. Elements (
FinBazeBookingChip,FinBazeReceiptButton,FinBazeTaxDueChip) are inline. useFinBaze()returns the instance forupdate,logout, and so on.- Components run in iframes, so they render only in the browser. In Next.js put them in a client component.
Pass stable references for fetchClientSecret; changing the function does not restart the session, but changing publishableKey does.