Add support for staging environments#459
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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?: booleanoption 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; |
| </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 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. | ||
|
|
jiwon85
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for staging environments by using staging.every.org.