Givebear LogoGivebear
Developer SDK

Configuration reference

Every Givebear SDK config field and data-givebear attribute, with types and defaults.

This page lists every configuration field accepted by the window.Givebear render methods, plus every data- attribute the SDK reads when it auto-mounts embeds. Field names, types, and defaults match the SDK source exactly.

For how to load the SDK and call these methods, see Installation and API. For copy-paste embeds, see Snippet examples.

All fields are passed as a single config object: gb.renderButton(target, config). The same fields map to data- attributes for auto-mounted embeds. See Data attributes.

Shared fields

Every widget accepts these base fields. At least one of organizationId or orgId is required so the SDK knows which account to credit.

Prop

Type

Widgets theme themselves with the organization's configured accent color automatically. Set accentColor only to pin a different color; pass a six-digit hex value so the readable text color can be derived.

appId is the OAuth client ID of a Givebear Connect app. Set it when a connected app embeds the widget so donations are attributed to that app. For server-controlled embeds (locked target, preset amounts, donor prefill), mint a session and pass sessionToken instead. See Embedded donations.

Button (renderButton)

A donate button that opens the modal. Extends the shared fields.

Prop

Type

Card (renderCard)

A card with title, description, and donate button. Extends the shared fields.

Prop

Type

Inline embed (renderInline)

The full donation form, rendered on the page or in a modal. Extends the shared fields. render is a back-compatible alias for renderInline.

Prop

Type

Givebear.open(config) opens the donation modal directly. It takes the shared fields only, with no extra options.

Thermometer (renderThermometer)

A campaign progress bar with raised total and recent donations. Extends the shared fields. Pair it with campaignId for campaign goals.

Prop

Type

Campaign hero (renderCampaignHero)

A full campaign block: title, raised total, progress bar, matching banner, donate button, and the recent-gift feed. Extends the shared fields. Requires campaignId.

Prop

Type

Supporters ticker (renderSupporters)

A one-line strip that cycles through the campaign's anonymized recent gifts ("Someone donated $50 · 3m ago"). Extends the shared fields. Requires campaignId. Renders nothing visible while the campaign has no recent gifts, so it never reserves empty space.

Event card (renderEventCard)

One published event as a card with date, time, location, and a register button linking to the hosted event page. Extends the shared fields.

Prop

Type

Prayer times (renderPrayerTimes)

Daily prayer times for the organization. Extends the shared fields.

Prop

Type

Calendar (renderCalendar)

Upcoming events for the organization. Extends the shared fields.

Prop

Type

The events-only embed (data-givebear-events) calls renderCalendar with category forced to "event". Any category you set on that element is overridden.

Data attributes

The SDK scans the page on load and mounts any element carrying a widget attribute. Add one widget attribute plus the config attributes you need. No JavaScript is required.

Widget selectors

Each attribute mounts one widget type. Use exactly one per element.

AttributeRenders
data-givebear-buttonDonate button (renderButton)
data-givebear-cardDonation card (renderCard)
data-givebear-embedInline donation form (renderInline)
data-givebear-thermometerCampaign thermometer (renderThermometer)
data-givebear-campaign-heroCampaign hero (renderCampaignHero)
data-givebear-supportersSupporters ticker (renderSupporters)
data-givebear-event-cardSingle event card (renderEventCard)
data-givebear-prayer-timesPrayer times (renderPrayerTimes)
data-givebear-calendarEvents calendar (renderCalendar)
data-givebear-eventsCalendar with category forced to event

Config attributes

These map to the config fields above. The SDK reads them via dataset, so camelCase fields become kebab-case attributes.

AttributeConfig fieldType
data-organization-idorganizationIdstring
data-org-idorgIdstring
data-fund-idfundIdstring
data-project-idprojectId (deprecated)string
data-campaign-idcampaignIdstring
data-event-ideventIdstring
data-accent-coloraccentColorstring
data-themetheme"auto" | "light" | "dark"
data-app-idappIdstring
data-session-tokensessionTokenstring
data-button-textbuttonTextstring
data-placementplacement"inline" | "modal"
data-modemodewidget-specific
data-time-formattimeFormat"12h" | "24h"
data-categorycategorystring
data-traditiontraditionstring
data-limitlimitnumber
data-cache-keycacheKeynumber | string
data-hide-recenthideRecentpresent, or "false" to disable

Only these data attributes are read. data-mode accepts the values valid for the widget on that element (for example full, card, or strip on a prayer times widget). Invalid values fall back to the widget default.

SDK-managed attributes

The SDK sets these itself. You do not add them.

AttributeMeaning
data-givebear-mountedSet to 1 after the SDK mounts an element, so it mounts once.
data-givebear-fallbackMarks a static SEO fallback node paired with a widget.
data-forOn a fallback node, the id of the widget it backs. Removed once the widget renders.

Auto-mount example

<div
  data-givebear-button
  data-organization-id="your-org-id"
  data-fund-id="your-fund-id"
  data-accent-color="#387A4B"
  data-theme="auto"
></div>
<script src="https://givebear.io/sdk/givebear.js" async></script>
Was this page helpful?

On this page