Skip to content

Add support for staging environments#459

Merged
santiher merged 5 commits into
mainfrom
sh/support_staging
May 22, 2026
Merged

Add support for staging environments#459
santiher merged 5 commits into
mainfrom
sh/support_staging

Conversation

@santiher
Copy link
Copy Markdown
Member

Adds support for staging environments by using staging.every.org.

@santiher santiher requested review from Copilot and jiwon85 May 21, 2026 12:24
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
donate-button Ready Ready Preview May 22, 2026 5:13pm

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a staging mode to donate-button v4 so the widget/button can target Every.org’s staging site (staging.every.org) and staging Partners API (partners-staging.every.org) when desired.

Changes:

  • Introduces staging/prod URL helpers (getSiteUrl, getApiUrl) and staging base constants.
  • Threads a staging?: boolean option through widget config/options, URL construction/parsing, and API fetch helpers.
  • Updates link auto-detection and documentation to describe staging usage.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Documents how to use staging via staging links and staging: true in create calls.
packages/donate-button-v4/src/helpers/parseDonateUrl.ts Detects staging hostnames and returns staging: true in parsed widget config.
packages/donate-button-v4/src/helpers/constructDonateUrl.ts Builds donate/gift URLs using getSiteUrl(staging) instead of a fixed prod base URL.
packages/donate-button-v4/src/constants/url.ts Adds staging base URLs plus getSiteUrl / getApiUrl helpers.
packages/donate-button-v4/src/components/widget/types/WidgetConfig.ts Adds staging?: boolean to widget configuration.
packages/donate-button-v4/src/components/widget/hooks/useSubmitDonation.ts Passes staging through to URL constructors when opening donation flows.
packages/donate-button-v4/src/components/widget/context/NonprofitContext.tsx Fetches nonprofit + customization from the staging API when configured.
packages/donate-button-v4/src/components/widget/context/index.tsx Propagates options.staging into the nonprofit context provider.
packages/donate-button-v4/src/components/widget/context/FundraiserContext.tsx Fetches fundraiser data from the staging API when configured.
packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx Uses getSiteUrl(staging) in the crypto-support email template.
packages/donate-button-v4/src/components/widget/api/index.ts Routes API calls through getApiUrl(staging).
packages/donate-button-v4/src/components/embed-button/types.ts Adds staging?: boolean to donate button options.
packages/donate-button-v4/src/autoPlayMode.tsx Detects and replaces both prod and staging Every.org donate links.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -102,8 +103,9 @@ const CryptoSelectorDropDownItem = ({
const CryptoSupprotLink = () => {
Comment on lines +7 to +10
export const getSiteUrl = (staging?: boolean) =>
staging ? STAGING_BASE_URL : BASE_URL;
export const getApiUrl = (staging?: boolean) =>
staging ? STAGING_API_URL : BASE_API_URL;
Comment thread README.md
</html>
```

Note that you can use the donate button in our staging environment by using a staging link like: https://staging.every.org/ofsds#/donate
Comment thread README.md
Comment on lines +74 to +75
Note that you can use the donate button in our staging environment by adding the `staging: true` parameter to the `create*` calls.

@santiher santiher merged commit ed798c7 into main May 22, 2026
6 checks passed
@santiher santiher deleted the sh/support_staging branch May 22, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants