Skip to content

feat: add support for overriding OneSignal script src #132

Merged
sherwinski merged 3 commits intomainfrom
feat/override-onesignal-script-src
Feb 23, 2026
Merged

feat: add support for overriding OneSignal script src #132
sherwinski merged 3 commits intomainfrom
feat/override-onesignal-script-src

Conversation

@sherwinski
Copy link
Contributor

Description

Enables support for overriding the script src for users who wish to self-host the SDK script. Fixes OneSignal/react-onesignal#145

Details

ONE_SIGNAL_SCRIPT_SRC is hardcoded to the CDN URL meaning that users with strict CSP headers cannot load it. This PR enables support for overriding the src URL for users who wish to self-host the SDK script themselves.

It's worth noting that this change will cause the SDK script to be loaded at init() time instead of module-import time, which is worth discussing.

`ONE_SIGNAL_SCRIPT_SRC` is hardcoded to the CDN URL meaning that users with strict COEP/CSP headers cannot load it. This commit enables support for overriding the script src for users who wish to self-host the SDK script.

It's worth noting that this change will cause the SDK script to be loaded at init() time instead of module-import time.

Fixes OneSignal/react-onesignal#145
Base automatically changed from chore/sync-outputs to main February 23, 2026 17:34
@sherwinski sherwinski merged commit 15e7a7d into main Feb 23, 2026
2 checks passed
@sherwinski sherwinski deleted the feat/override-onesignal-script-src branch February 23, 2026 17:55
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.

[Question]: Is there a specific reason you can not over ride ONE_SIGNAL_SCRIPT_SRC

2 participants