SDKs
Headless sessions are for platforms that want their own screens. Unlike iframe components, the token lives in your page, so your page's security becomes part of FinBaze's. They are off by default (platforms.headless) and allowed only from origins you list as headless origins.
import { FinBazeHeadlessProvider, useTransactions, useTaxDue } from "@finbaze/embed-react/headless";
function Dashboard() {
const { items, hasMore, loadMore } = useTransactions({ pageSize: 25 });
const tax = useTaxDue();
return (/* your UI */);
}
<FinBazeHeadlessProvider publishableKey="fb_pk_test_…" fetchClientSecret={fetchHeadlessSecret}>
<Dashboard />
</FinBazeHeadlessProvider>
Create the secret with kind: headless in createEmbedSession. The provider exchanges it in your page, refreshes it before expiry with a new secret, and asks for a new session once if it is revoked.
| Hook | Returns |
|---|---|
useCompany() | the session's company, user, locale and open onboarding requirements |
useActionCentre() | counts and the prioritised to-do items |
useTaxDue() | the next tax filings with deadlines |
useTransactions({ pageSize, filter }) | a paged list: items, loading, error, hasMore, loadMore() |
useBooking(lookup) | one booking summary and attachReceipt(file) |
useTaxAuthorisation() | the company's filing consent: status, statement(taxes), grant({ statement, stepUp? }), revoke() and history(). Needs the tax-authorisation or onboarding component |
Headless tokens run the same allowlisted operations as components, for the components in the session.