Overview
@tender-cash/donation-sdk is a React widget for collecting cryptocurrency donations.
It renders a donation form — campaign header with fundraising progress, amount entry with a fiat/crypto toggle, preset amounts, asset and network pickers, and a fee breakdown — followed by a deposit screen with a QR code, wallet address and countdown.
The widget mounts inside a Shadow DOM root, so its styles never leak into (or inherit from) your page.
@tender-cash/donation-sdk
Donation widget package for React
Installation
React 16.8 or later is required —
react and react-dom are peer dependencies.Quickstart
The widget fetches its campaign from the Tender API using youraccessId, so the header fills itself in — no campaign props required.
The Tender API does not store a fundraising target, so pass
campaign={{ goal }} yourself to render the progress ring.Opening the widget imperatively
Hold a ref and callopenDonation when the donor clicks your own button. With a ref attached, the component renders nothing until then.
API Reference
Component Props (TenderDonationProps)
Required Props
Optional Props
DonationCampaign
Every field is optional — each one overrides what the API returned.
Donor
Ref Methods (TenderDonationRef)
Campaign resolution
GET /system/campaign resolves your accessId to its agent and returns the merchant profile plus that agent’s transaction stats:
Anything passed in
campaign overrides the fetched value. The goal is the exception — the API does not store a fundraising target, so pass campaign={{ goal }} yourself. The progress ring only renders when a goal is available; without one the widget shows the raised amount alone.
If the campaign request fails, the widget carries on with whatever campaign props were supplied — a missing header never blocks a donation.
Amount entry
The amount field accepts either fiat or crypto. The toggle beside it swaps the denomination and converts the current value using the rate Tender returns for the selected asset, so the donation stays worth the same either way. When the API prices an asset, the form also shows the rate and aTotal send line — the donation plus the network fee for the chosen chain.
Donation status events
onEventResponse fires as the donation progresses:
Callback Data (onFinishResponse)
data carries the transaction id, wallet address, chain, asset, amounts, and — when known — the campaign id and donor details.
Routing calls through your backend
PassapiRequest to keep credentials server-side. The SDK then calls your function instead of the Tender API directly, so request signing and secrets never reach the browser.
TenderApiRequest
Exports
TenderDonationSdk— the widget componentTenderDonationProps— component propsTenderDonationRef— imperative handle typeDonationCampaign,Donor,DonationMeta,StartDonationParamsIDonationData,DonationStatusProps,onFinishResponseTenderEnvironments,TenderApiRequest
Features
- Shadow DOM style isolation
- Automatic campaign resolution from your Access ID
- Fundraising progress ring
- Fiat/crypto amount toggle with live rates
- Preset donation amounts and min/max limits
- Optional donor detail capture and anonymous donations
- Auto-open or programmatic control with refs
- Optional backend proxy to keep credentials server-side
- Full TypeScript support
Next Steps
API Reference
Explore the full API documentation
Webhooks
Set up webhook notifications
GitHub
View source repositories
Support
Contact our support team