feat: Support CNAME for launcher.js#34
Merged
Merged
Conversation
1 task
alexs-mparticle
requested changes
Jun 9, 2025
Comment on lines
+39
to
+47
| function generateLauncherScript(domain) { | ||
| // If a customer is using a CNAME, a domain will be passed. If not, we use the default domain. | ||
| if (!domain) { | ||
| domain = 'apps.rokt.com'; | ||
| } | ||
| var protocol = 'https://'; | ||
| var launcherPath = '/wsdk/integrations/launcher.js'; | ||
|
|
||
| return [protocol, domain, launcherPath].join(''); |
Collaborator
There was a problem hiding this comment.
I think it's bad practice to mutate the parameter if we can avoid it.
Suggested change
| function generateLauncherScript(domain) { | |
| // If a customer is using a CNAME, a domain will be passed. If not, we use the default domain. | |
| if (!domain) { | |
| domain = 'apps.rokt.com'; | |
| } | |
| var protocol = 'https://'; | |
| var launcherPath = '/wsdk/integrations/launcher.js'; | |
| return [protocol, domain, launcherPath].join(''); | |
| function generateLauncherScript(_domain) { | |
| // If a customer is using a CNAME, a domain will be passed. If not, we use the default domain. | |
| var domain = typeof _domain !== 'undefined' ? _domain : 'apps.rokt.com'; | |
| var protocol = 'https://'; | |
| var launcherPath = '/wsdk/integrations/launcher.js'; | |
| return [protocol, domain, launcherPath].join(''); |
Co-authored-by: Alex S <49695018+alexs-mparticle@users.noreply.github.com>
Co-authored-by: Alex S <49695018+alexs-mparticle@users.noreply.github.com>
Co-authored-by: Alex S <49695018+alexs-mparticle@users.noreply.github.com>
Co-authored-by: Alex S <49695018+alexs-mparticle@users.noreply.github.com>
alexs-mparticle
approved these changes
Jun 10, 2025
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 10, 2025
# [1.5.0](v1.4.1...v1.5.0) (2025-06-10) ### Features * Support CNAME for launcher.js ([#34](#34)) ([58efaaa](58efaaa))
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.
Summary
Building off of https://github.com/mparticle-integrations/mparticle-javascript-integration-rokt/pull/26/files, this PR adds the ability to create a baseURL based off of a domain that is passed in from
mParticle.Rokt.domainin order to CNAME launcher.jsTesting Plan
Added unit tests and tested locally in a test app.