Integrate
Admin widgets
Show live campaign metrics, fiscal receipts and the charities selection of an account inside your product or your back office, without opening the dashboard.
The admin widgets bring screens of the Charitips dashboard into your product: a campaign's live figures, the figures of all campaigns, the fiscal receipts, and the charities a campaign offers. Your customers stay in your product, and you build none of these screens. They also fit your own back office, for your team to follow your customers' campaigns.
In short
- Your server creates a token with Create an admin widget token for the
accountIdwhose data the widget shows, yours or a child account's. It is valid one day. - One function or component per screen, chosen by
type:campaign-metrics,global-metrics,fiscal-receipts,charities-selection. campaign-metricsandcharities-selectionalso take acampaignId.
Create the token
curl -X POST https://api.sandbox.charitips.com/v1/authentication/widget \ -H "Authorization: Bearer $CHARITIPS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "accountId": "<accountId>" }'Request bodies are written for this docs and checked against the API's validation; ids in angle brackets are placeholders. Response values are placeholders built from the schema.
The token opens the data of that account only. With account hierarchy, pass the child's accountId to show a customer its own data; an accountId that is neither yours nor one of your children's answers 400. Create a new token before the day is over when a screen stays open longer.
Show a widget
import { AdminCampaignMetricsWidget } from '@charitips/embed-react'; export function CampaignScreen({ token, campaignId }: { token: string; campaignId: string }) { return <AdminCampaignMetricsWidget token={token} campaignId={campaignId} />;}type | React component | What it shows |
|---|---|---|
campaign-metrics | AdminCampaignMetricsWidget | the live figures of one campaign, with campaignId |
global-metrics | AdminGlobalMetricsWidget | the figures of all the account's campaigns |
fiscal-receipts | AdminFiscalReceiptsWidget | the account's fiscal receipts, ready to download |
charities-selection | AdminCharitiesSelectionWidget | the charities a campaign offers, to change them, with campaignId |
They also take the shared options: see Options every widget shares.