Skip to content

feat: Support CNAME for launcher.js#34

Merged
rmi22186 merged 7 commits into
developmentfrom
feat/SQDSDKS-7386-support-cname
Jun 10, 2025
Merged

feat: Support CNAME for launcher.js#34
rmi22186 merged 7 commits into
developmentfrom
feat/SQDSDKS-7386-support-cname

Conversation

@rmi22186
Copy link
Copy Markdown
Collaborator

@rmi22186 rmi22186 commented Jun 9, 2025

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.domain in order to CNAME launcher.js

Testing Plan

Added unit tests and tested locally in a test app.

Comment thread src/Rokt-Kit.js Outdated
Comment thread src/Rokt-Kit.js
Comment thread src/Rokt-Kit.js Outdated
Comment thread src/Rokt-Kit.js Outdated
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('');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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('');

Comment thread test/src/tests.js Outdated
rmi22186 and others added 5 commits June 9, 2025 17:39
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>
@rmi22186 rmi22186 changed the base branch from main to development June 10, 2025 11:28
@rmi22186 rmi22186 merged commit 58efaaa into development Jun 10, 2025
4 checks passed
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))
@alexs-mparticle alexs-mparticle deleted the feat/SQDSDKS-7386-support-cname branch March 25, 2026 15:15
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.

2 participants