Skip to content
Aller au contenu
Charitips

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 accountId whose 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-metrics and charities-selection also take a campaignId.

Create the token

POST /v1/authentication/widget
curl -X POST https://api.sandbox.charitips.com/v1/authentication/widget \  -H "Authorization: Bearer $CHARITIPS_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "accountId": "<accountId>"  }'
Built from the spec and the API code

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

tsx
import { AdminCampaignMetricsWidget } from '@charitips/embed-react'; export function CampaignScreen({ token, campaignId }: { token: string; campaignId: string }) {  return <AdminCampaignMetricsWidget token={token} campaignId={campaignId} />;}
typeReact componentWhat it shows
campaign-metricsAdminCampaignMetricsWidgetthe live figures of one campaign, with campaignId
global-metricsAdminGlobalMetricsWidgetthe figures of all the account's campaigns
fiscal-receiptsAdminFiscalReceiptsWidgetthe account's fiscal receipts, ready to download
charities-selectionAdminCharitiesSelectionWidgetthe charities a campaign offers, to change them, with campaignId

They also take the shared options: see Options every widget shares.

Campaign metrics

Loading the widget from the sandbox
Live widget, connected to the sandbox.

All campaigns

Loading the widget from the sandbox
Live widget, connected to the sandbox.

Fiscal receipts

Loading the widget from the sandbox
Live widget, connected to the sandbox.

Charities of a campaign

Loading the widget from the sandbox
Live widget, connected to the sandbox.

Account hierarchy, Billing and fiscal receipts, Widgets.