From 2b7ea8f53c72115eef8c8d6ddcbd23a2e343bfb9 Mon Sep 17 00:00:00 2001 From: Santiago Date: Thu, 21 May 2026 08:23:45 -0300 Subject: [PATCH 1/5] Add support for staging environments --- .../donate-button-v4/src/autoPlayMode.tsx | 4 +++- .../src/components/embed-button/types.ts | 2 ++ .../src/components/widget/api/index.ts | 22 +++++++++++++------ .../CryptoFlow/CryptoSelector.tsx | 6 +++-- .../widget/context/FundraiserContext.tsx | 10 ++++++--- .../widget/context/NonprofitContext.tsx | 12 +++++----- .../src/components/widget/context/index.tsx | 1 + .../widget/hooks/useSubmitDonation.ts | 9 +++++--- .../components/widget/types/WidgetConfig.ts | 2 ++ .../donate-button-v4/src/constants/url.ts | 3 +++ .../src/helpers/constructDonateUrl.ts | 18 ++++++++++----- .../src/helpers/parseDonateUrl.ts | 5 ++++- 12 files changed, 67 insertions(+), 27 deletions(-) diff --git a/packages/donate-button-v4/src/autoPlayMode.tsx b/packages/donate-button-v4/src/autoPlayMode.tsx index a6c9c365..fb74ec02 100644 --- a/packages/donate-button-v4/src/autoPlayMode.tsx +++ b/packages/donate-button-v4/src/autoPlayMode.tsx @@ -114,7 +114,9 @@ function createButton({element, ...options}: CreateButtonProps) { } function findAndReplaceLinks() { - const links = document.querySelectorAll("*[href^='https://www.every.org/']"); + const links = document.querySelectorAll( + "*[href^='https://www.every.org/'], *[href^='https://staging.every.org/']" + ); links.forEach((link) => { const urlString = link.getAttribute('href'); diff --git a/packages/donate-button-v4/src/components/embed-button/types.ts b/packages/donate-button-v4/src/components/embed-button/types.ts index 089c28ee..4e19db80 100644 --- a/packages/donate-button-v4/src/components/embed-button/types.ts +++ b/packages/donate-button-v4/src/components/embed-button/types.ts @@ -23,6 +23,8 @@ export interface DonateButtonOptions { readonly noExit?: boolean; url?: string; + + staging?: boolean; } export interface EmbedButtonOptions extends DonateButtonOptions { readonly label?: string; diff --git a/packages/donate-button-v4/src/components/widget/api/index.ts b/packages/donate-button-v4/src/components/widget/api/index.ts index 1d6a5b66..53781514 100644 --- a/packages/donate-button-v4/src/components/widget/api/index.ts +++ b/packages/donate-button-v4/src/components/widget/api/index.ts @@ -1,7 +1,7 @@ import {DonateFlowCustomization} from 'src/components/widget/types/DonateFlowCustomization'; import {Fundraiser} from 'src/components/widget/types/Fundraiser'; import {Nonprofit} from 'src/components/widget/types/Nonprofit'; -import {BASE_API_URL, BASE_COINGECKO_URL} from 'src/constants/url'; +import {BASE_API_URL, BASE_COINGECKO_URL, STAGING_API_URL} from 'src/constants/url'; type NonprofitResponse = { message: string; @@ -17,9 +17,10 @@ type FundraiserResponse = { }; }; -export async function getNonprofit(nonprofitSlug: string) { +export async function getNonprofit(nonprofitSlug: string, staging?: boolean) { + const apiUrl = staging ? STAGING_API_URL : BASE_API_URL; const data: NonprofitResponse = await fetch( - `${BASE_API_URL}/${nonprofitSlug}` + `${apiUrl}/${nonprofitSlug}` ).then(async (response) => response.json()); return data.data.nonprofit; @@ -27,9 +28,11 @@ export async function getNonprofit(nonprofitSlug: string) { export async function getFundraiser( nonprofitSlug: string, - fundraiserSlug: string + fundraiserSlug: string, + staging?: boolean ) { - const url = `${BASE_API_URL}/${nonprofitSlug}/fundraiser/${fundraiserSlug}`; + const apiUrl = staging ? STAGING_API_URL : BASE_API_URL; + const url = `${apiUrl}/${nonprofitSlug}/fundraiser/${fundraiserSlug}`; const data: FundraiserResponse = await fetch(url).then(async (response) => response.json() ); @@ -52,8 +55,13 @@ export async function getCoingeckoRate(coingeckoId: string) { return (data as CoingeckoData).market_data.current_price.usd; } -export async function getCustomization(nonprofitId: string, code?: string) { - const url = `${BASE_API_URL}/${nonprofitId}/customization${ +export async function getCustomization( + nonprofitId: string, + code?: string, + staging?: boolean +) { + const apiUrl = staging ? STAGING_API_URL : BASE_API_URL; + const url = `${apiUrl}/${nonprofitId}/customization${ code ? `?code=${code}` : '' }`; const response = await fetch(url).then(async (response) => { diff --git a/packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx b/packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx index b8bd06bf..fd8717db 100644 --- a/packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx +++ b/packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx @@ -1,4 +1,5 @@ import {filter as fuzzyFilter} from 'fuzzy'; +import {BASE_URL, STAGING_BASE_URL} from 'src/constants/url'; import {useRef, useState} from 'preact/hooks'; import {Fragment} from 'preact/jsx-runtime'; import {linkCss} from 'src/components/widget/components/FundraiserLink/styles'; @@ -102,8 +103,9 @@ const CryptoSelectorDropDownItem = ({ const CryptoSupprotLink = () => { const nonprofit = useNonprofitOrError(); - const {primaryColor} = useConfigContext(); - const cryptoSupportBody = `Contents: I would like to make a crypto donation to support https://www.every.org/${nonprofit.primarySlug}.\n\nMy name:\nToken name:\nToken symbol:\nToken quantity:\n\nPlease reply back with an address where I can donate, as this is worth over $100,000 USD.`; + const {primaryColor, staging} = useConfigContext(); + const baseUrl = staging ? STAGING_BASE_URL : BASE_URL; + const cryptoSupportBody = `Contents: I would like to make a crypto donation to support ${baseUrl}${nonprofit.primarySlug}.\n\nMy name:\nToken name:\nToken symbol:\nToken quantity:\n\nPlease reply back with an address where I can donate, as this is worth over $100,000 USD.`; return ( ({ export const FundraiserContextProvider: FunctionalComponent<{ fundraiserSlug?: string; }> = ({children}) => { - const {fundraiserSlug, nonprofitSlug} = useConfigContext(); + const {fundraiserSlug, nonprofitSlug, staging} = useConfigContext(); const [fundraiser, setFundraiser] = useState(FundraiserFetching); @@ -32,12 +32,16 @@ export const FundraiserContextProvider: FunctionalComponent<{ } try { - const response = await getFundraiser(nonprofitSlug, fundraiserSlug); + const response = await getFundraiser( + nonprofitSlug, + fundraiserSlug, + staging + ); setFundraiser(response); } catch { setFundraiser(FundraiserFetchError); } - }, [nonprofitSlug, fundraiserSlug]); + }, [nonprofitSlug, fundraiserSlug, staging]); useEffect(() => { // eslint-disable-next-line @typescript-eslint/no-floating-promises diff --git a/packages/donate-button-v4/src/components/widget/context/NonprofitContext.tsx b/packages/donate-button-v4/src/components/widget/context/NonprofitContext.tsx index fd59c510..9619ae48 100644 --- a/packages/donate-button-v4/src/components/widget/context/NonprofitContext.tsx +++ b/packages/donate-button-v4/src/components/widget/context/NonprofitContext.tsx @@ -30,7 +30,8 @@ export const NonprofitContext = createContext({ export const NonprofitContextProvider: FunctionalComponent<{ nonprofitSlug?: string; code?: string; -}> = ({children, nonprofitSlug, code}) => { + staging?: boolean; +}> = ({children, nonprofitSlug, code, staging}) => { const [nonprofit, setNonprofit] = useState(NonprofitFetching); const [parentNonprofit, setParentNonprofitNonprofit] = @@ -45,7 +46,7 @@ export const NonprofitContextProvider: FunctionalComponent<{ throw new Error('No nonprofit slug provided'); } - const response = await getNonprofit(nonprofitSlug); + const response = await getNonprofit(nonprofitSlug, staging); setNonprofit(response); const parentNonprofitId = @@ -55,7 +56,7 @@ export const NonprofitContextProvider: FunctionalComponent<{ if (parentNonprofitId) { try { - const response = await getNonprofit(parentNonprofitId); + const response = await getNonprofit(parentNonprofitId, staging); setParentNonprofitNonprofit(response); } catch { setParentNonprofitNonprofit(undefined); @@ -66,7 +67,8 @@ export const NonprofitContextProvider: FunctionalComponent<{ try { const customizationResponse = await getCustomization( response.id, - code + code, + staging ); setCustomization(customizationResponse); } catch { @@ -78,7 +80,7 @@ export const NonprofitContextProvider: FunctionalComponent<{ } catch { setNonprofit(NonprofitFetchError); } - }, [nonprofitSlug, code]); + }, [nonprofitSlug, code, staging]); useEffect(() => { // eslint-disable-next-line @typescript-eslint/no-floating-promises diff --git a/packages/donate-button-v4/src/components/widget/context/index.tsx b/packages/donate-button-v4/src/components/widget/context/index.tsx index b364f216..45c3a714 100644 --- a/packages/donate-button-v4/src/components/widget/context/index.tsx +++ b/packages/donate-button-v4/src/components/widget/context/index.tsx @@ -12,6 +12,7 @@ export const ContextProvider: FunctionComponent<{ diff --git a/packages/donate-button-v4/src/components/widget/hooks/useSubmitDonation.ts b/packages/donate-button-v4/src/components/widget/hooks/useSubmitDonation.ts index 490c4213..1dbf996f 100644 --- a/packages/donate-button-v4/src/components/widget/hooks/useSubmitDonation.ts +++ b/packages/donate-button-v4/src/components/widget/hooks/useSubmitDonation.ts @@ -39,7 +39,8 @@ export const useSubmitDonation = () => { webhookToken, redeemGiftCardInFlow, designation, - requireShareInfo + requireShareInfo, + staging } = useConfigContext(); const submitDonation = useCallback( @@ -72,7 +73,8 @@ export const useSubmitDonation = () => { partnerMetadata: config.partnerMetadata, designation, requireShareInfo, - customFieldResponses + customFieldResponses, + staging }; switch (selectedPaymentMethod) { case PaymentMethod.CRYPTO: @@ -156,7 +158,8 @@ export const useSubmitDonation = () => { designation, requireShareInfo, customization, - customFieldValues + customFieldValues, + staging ] ); diff --git a/packages/donate-button-v4/src/components/widget/types/WidgetConfig.ts b/packages/donate-button-v4/src/components/widget/types/WidgetConfig.ts index 6b5ef6a2..1e2a4209 100644 --- a/packages/donate-button-v4/src/components/widget/types/WidgetConfig.ts +++ b/packages/donate-button-v4/src/components/widget/types/WidgetConfig.ts @@ -57,4 +57,6 @@ export interface WidgetConfig { previewMode?: boolean; code?: string; + + staging?: boolean; } diff --git a/packages/donate-button-v4/src/constants/url.ts b/packages/donate-button-v4/src/constants/url.ts index 85defd05..db7ff87c 100644 --- a/packages/donate-button-v4/src/constants/url.ts +++ b/packages/donate-button-v4/src/constants/url.ts @@ -1,5 +1,8 @@ export const BASE_URL = 'https://www.every.org/'; export const BASE_API_URL = 'https://partners.every.org/v0.2/nonprofit'; + +export const STAGING_BASE_URL = 'https://staging.every.org/'; +export const STAGING_API_URL = 'https://partners-staging.every.org/v0.2/nonprofit'; export const BASE_CLOUDINARY_URL = 'https://res.cloudinary.com/everydotorg/image/upload/'; export const BASE_COINGECKO_URL = 'https://api.coingecko.com/api/v3'; diff --git a/packages/donate-button-v4/src/helpers/constructDonateUrl.ts b/packages/donate-button-v4/src/helpers/constructDonateUrl.ts index d1dee17c..2e9b1a21 100644 --- a/packages/donate-button-v4/src/helpers/constructDonateUrl.ts +++ b/packages/donate-button-v4/src/helpers/constructDonateUrl.ts @@ -4,7 +4,11 @@ import { DonateUrlParameters, UTM_QUERY_PARAM } from 'src/components/widget/types/UrlParams'; -import {BASE_URL, GIFT_CARD_URL} from 'src/constants/url'; +import { + BASE_URL, + GIFT_CARD_ROUTE, + STAGING_BASE_URL +} from 'src/constants/url'; const UTM_MEDIUM = 'donate-button-0.4'; // Update this if the major version changes const HASH = 'donate'; @@ -23,6 +27,7 @@ interface BaseUrlParams { designation?: string; requireShareInfo?: boolean; customFieldResponses?: string; + staging?: boolean; } interface DonateUrlParams extends BaseUrlParams { @@ -59,9 +64,10 @@ function serializeParams( function getBaseUrl({ fundraiserSlug, - nonprofitSlug -}: Pick) { - let baseUrl = BASE_URL + nonprofitSlug; + nonprofitSlug, + staging +}: Pick) { + let baseUrl = (staging ? STAGING_BASE_URL : BASE_URL) + nonprofitSlug; if (fundraiserSlug) { baseUrl += '/f/' + fundraiserSlug; @@ -211,9 +217,11 @@ export function constructGiftCardUrl({ return `${baseUrl}?${parameters}#/${HASH}`; } + const giftCardUrl = + (rest.staging ? STAGING_BASE_URL : BASE_URL) + GIFT_CARD_ROUTE; const parameters = serializeParams({ nonprofitSlug: rest.nonprofitSlug }); - return `${GIFT_CARD_URL}?${parameters}`; + return `${giftCardUrl}?${parameters}`; } diff --git a/packages/donate-button-v4/src/helpers/parseDonateUrl.ts b/packages/donate-button-v4/src/helpers/parseDonateUrl.ts index 49fc82fd..44b3e839 100644 --- a/packages/donate-button-v4/src/helpers/parseDonateUrl.ts +++ b/packages/donate-button-v4/src/helpers/parseDonateUrl.ts @@ -121,6 +121,8 @@ export function parseDonateUrl( return; } + const staging = url.hostname === 'staging.every.org' || undefined; + return removeEmptyValues({ fundraiserSlug, nonprofitSlug, @@ -138,6 +140,7 @@ export function parseDonateUrl( requireShareInfo, webhookToken, partnerMetadata, - code + code, + staging }); } From 1ae8fb94052af7042327d45c3767c5dcd099d125 Mon Sep 17 00:00:00 2001 From: Santiago Date: Thu, 21 May 2026 08:34:08 -0300 Subject: [PATCH 2/5] factorize url getting --- .../src/components/widget/api/index.ts | 8 ++++---- .../PaymentProcess/CryptoFlow/CryptoSelector.tsx | 4 ++-- packages/donate-button-v4/src/constants/url.ts | 6 ++++++ .../src/helpers/constructDonateUrl.ts | 11 +++-------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/donate-button-v4/src/components/widget/api/index.ts b/packages/donate-button-v4/src/components/widget/api/index.ts index 53781514..afebd55b 100644 --- a/packages/donate-button-v4/src/components/widget/api/index.ts +++ b/packages/donate-button-v4/src/components/widget/api/index.ts @@ -1,7 +1,7 @@ import {DonateFlowCustomization} from 'src/components/widget/types/DonateFlowCustomization'; import {Fundraiser} from 'src/components/widget/types/Fundraiser'; import {Nonprofit} from 'src/components/widget/types/Nonprofit'; -import {BASE_API_URL, BASE_COINGECKO_URL, STAGING_API_URL} from 'src/constants/url'; +import {BASE_COINGECKO_URL, getApiUrl} from 'src/constants/url'; type NonprofitResponse = { message: string; @@ -18,7 +18,7 @@ type FundraiserResponse = { }; export async function getNonprofit(nonprofitSlug: string, staging?: boolean) { - const apiUrl = staging ? STAGING_API_URL : BASE_API_URL; + const apiUrl = getApiUrl(staging); const data: NonprofitResponse = await fetch( `${apiUrl}/${nonprofitSlug}` ).then(async (response) => response.json()); @@ -31,7 +31,7 @@ export async function getFundraiser( fundraiserSlug: string, staging?: boolean ) { - const apiUrl = staging ? STAGING_API_URL : BASE_API_URL; + const apiUrl = getApiUrl(staging); const url = `${apiUrl}/${nonprofitSlug}/fundraiser/${fundraiserSlug}`; const data: FundraiserResponse = await fetch(url).then(async (response) => response.json() @@ -60,7 +60,7 @@ export async function getCustomization( code?: string, staging?: boolean ) { - const apiUrl = staging ? STAGING_API_URL : BASE_API_URL; + const apiUrl = getApiUrl(staging); const url = `${apiUrl}/${nonprofitId}/customization${ code ? `?code=${code}` : '' }`; diff --git a/packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx b/packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx index fd8717db..0c4d696d 100644 --- a/packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx +++ b/packages/donate-button-v4/src/components/widget/components/PaymentProcess/CryptoFlow/CryptoSelector.tsx @@ -1,5 +1,5 @@ import {filter as fuzzyFilter} from 'fuzzy'; -import {BASE_URL, STAGING_BASE_URL} from 'src/constants/url'; +import {getSiteUrl} from 'src/constants/url'; import {useRef, useState} from 'preact/hooks'; import {Fragment} from 'preact/jsx-runtime'; import {linkCss} from 'src/components/widget/components/FundraiserLink/styles'; @@ -104,7 +104,7 @@ const CryptoSupprotLink = () => { const nonprofit = useNonprofitOrError(); const {primaryColor, staging} = useConfigContext(); - const baseUrl = staging ? STAGING_BASE_URL : BASE_URL; + const baseUrl = getSiteUrl(staging); const cryptoSupportBody = `Contents: I would like to make a crypto donation to support ${baseUrl}${nonprofit.primarySlug}.\n\nMy name:\nToken name:\nToken symbol:\nToken quantity:\n\nPlease reply back with an address where I can donate, as this is worth over $100,000 USD.`; return ( diff --git a/packages/donate-button-v4/src/constants/url.ts b/packages/donate-button-v4/src/constants/url.ts index db7ff87c..7cf09cd6 100644 --- a/packages/donate-button-v4/src/constants/url.ts +++ b/packages/donate-button-v4/src/constants/url.ts @@ -3,6 +3,12 @@ export const BASE_API_URL = 'https://partners.every.org/v0.2/nonprofit'; export const STAGING_BASE_URL = 'https://staging.every.org/'; export const STAGING_API_URL = 'https://partners-staging.every.org/v0.2/nonprofit'; + +export const getSiteUrl = (staging?: boolean) => + staging ? STAGING_BASE_URL : BASE_URL; +export const getApiUrl = (staging?: boolean) => + staging ? STAGING_API_URL : BASE_API_URL; + export const BASE_CLOUDINARY_URL = 'https://res.cloudinary.com/everydotorg/image/upload/'; export const BASE_COINGECKO_URL = 'https://api.coingecko.com/api/v3'; diff --git a/packages/donate-button-v4/src/helpers/constructDonateUrl.ts b/packages/donate-button-v4/src/helpers/constructDonateUrl.ts index 2e9b1a21..de426b56 100644 --- a/packages/donate-button-v4/src/helpers/constructDonateUrl.ts +++ b/packages/donate-button-v4/src/helpers/constructDonateUrl.ts @@ -4,11 +4,7 @@ import { DonateUrlParameters, UTM_QUERY_PARAM } from 'src/components/widget/types/UrlParams'; -import { - BASE_URL, - GIFT_CARD_ROUTE, - STAGING_BASE_URL -} from 'src/constants/url'; +import {GIFT_CARD_ROUTE, getSiteUrl} from 'src/constants/url'; const UTM_MEDIUM = 'donate-button-0.4'; // Update this if the major version changes const HASH = 'donate'; @@ -67,7 +63,7 @@ function getBaseUrl({ nonprofitSlug, staging }: Pick) { - let baseUrl = (staging ? STAGING_BASE_URL : BASE_URL) + nonprofitSlug; + let baseUrl = getSiteUrl(staging) + nonprofitSlug; if (fundraiserSlug) { baseUrl += '/f/' + fundraiserSlug; @@ -217,8 +213,7 @@ export function constructGiftCardUrl({ return `${baseUrl}?${parameters}#/${HASH}`; } - const giftCardUrl = - (rest.staging ? STAGING_BASE_URL : BASE_URL) + GIFT_CARD_ROUTE; + const giftCardUrl = getSiteUrl(rest.staging) + GIFT_CARD_ROUTE; const parameters = serializeParams({ nonprofitSlug: rest.nonprofitSlug }); From e77f8735453df4f42070abd368b44144cd8e8726 Mon Sep 17 00:00:00 2001 From: Santiago Date: Thu, 21 May 2026 08:41:43 -0300 Subject: [PATCH 3/5] improvement --- packages/donate-button-v4/src/autoPlayMode.tsx | 3 ++- packages/donate-button-v4/src/helpers/parseDonateUrl.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/donate-button-v4/src/autoPlayMode.tsx b/packages/donate-button-v4/src/autoPlayMode.tsx index fb74ec02..1249a233 100644 --- a/packages/donate-button-v4/src/autoPlayMode.tsx +++ b/packages/donate-button-v4/src/autoPlayMode.tsx @@ -1,6 +1,7 @@ import {render as preactRender} from 'preact'; import EmbedButton from 'src/components/embed-button'; import {WidgetConfig} from 'src/components/widget/types/WidgetConfig'; +import {BASE_URL, STAGING_BASE_URL} from 'src/constants/url'; import {parseDonateUrl} from 'src/helpers/parseDonateUrl'; import shouldApplyEveryStyleForAllLinks from 'src/helpers/shouldApplyEveryStyleForAllLinks'; import {loadFonts} from 'src/loadFonts'; @@ -115,7 +116,7 @@ function createButton({element, ...options}: CreateButtonProps) { function findAndReplaceLinks() { const links = document.querySelectorAll( - "*[href^='https://www.every.org/'], *[href^='https://staging.every.org/']" + `*[href^='${BASE_URL}'], *[href^='${STAGING_BASE_URL}']` ); links.forEach((link) => { diff --git a/packages/donate-button-v4/src/helpers/parseDonateUrl.ts b/packages/donate-button-v4/src/helpers/parseDonateUrl.ts index 44b3e839..4b250b00 100644 --- a/packages/donate-button-v4/src/helpers/parseDonateUrl.ts +++ b/packages/donate-button-v4/src/helpers/parseDonateUrl.ts @@ -8,8 +8,10 @@ import { UTM_QUERY_PARAM } from 'src/components/widget/types/UrlParams'; import {WidgetConfig} from 'src/components/widget/types/WidgetConfig'; +import {STAGING_BASE_URL} from 'src/constants/url'; const MAX_AMOUNT_SUGGESTIONS = 5; +const STAGING_HOSTNAME = new URL(STAGING_BASE_URL).hostname; /** * Just for backwards compatibility @@ -121,7 +123,7 @@ export function parseDonateUrl( return; } - const staging = url.hostname === 'staging.every.org' || undefined; + const staging = url.hostname === STAGING_HOSTNAME || undefined; return removeEmptyValues({ fundraiserSlug, From 74fc9ceffff529d681246d07152ed64cd57981af Mon Sep 17 00:00:00 2001 From: Santiago Date: Thu, 21 May 2026 09:23:10 -0300 Subject: [PATCH 4/5] Update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index bbdb4db3..900fffbb 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ The below code will use Every.org styling, because the `a` tag has the `data-eve ``` +Note that you can use the donate button in our staging environment by using a staging link like: https://staging.every.org/ofsds#/donate + ## Configure To configure your button manually, add `?explicit=1` to the script `src` @@ -69,6 +71,8 @@ Here is an example html file with a manual configuration. ``` +Note that you can use the donate button in our staging environment by adding the `staging: true` parameter to the `create*` calls. + ### Widget #### Configuration options From fec8366ca904dbbe8c4457cee07b98ed57a5cb29 Mon Sep 17 00:00:00 2001 From: Santiago Date: Fri, 22 May 2026 14:13:03 -0300 Subject: [PATCH 5/5] lint --- packages/donate-button-v4/src/constants/url.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/donate-button-v4/src/constants/url.ts b/packages/donate-button-v4/src/constants/url.ts index 7cf09cd6..615b8cbc 100644 --- a/packages/donate-button-v4/src/constants/url.ts +++ b/packages/donate-button-v4/src/constants/url.ts @@ -2,7 +2,8 @@ export const BASE_URL = 'https://www.every.org/'; export const BASE_API_URL = 'https://partners.every.org/v0.2/nonprofit'; export const STAGING_BASE_URL = 'https://staging.every.org/'; -export const STAGING_API_URL = 'https://partners-staging.every.org/v0.2/nonprofit'; +export const STAGING_API_URL = + 'https://partners-staging.every.org/v0.2/nonprofit'; export const getSiteUrl = (staging?: boolean) => staging ? STAGING_BASE_URL : BASE_URL;