Skip to content

[WEB-273] Update WebSDK integration snippet to new format - #48

Open
Aman-engg-sdk wants to merge 1 commit into
masterfrom
patch/WEB-273-update-websdk-snippet
Open

[WEB-273] Update WebSDK integration snippet to new format#48
Aman-engg-sdk wants to merge 1 commit into
masterfrom
patch/WEB-273-update-websdk-snippet

Conversation

@Aman-engg-sdk

@Aman-engg-sdk Aman-engg-sdk commented May 27, 2026

Copy link
Copy Markdown
Contributor

WEB-273 Update WebSDK integration snippet to new format

Summary

Updates the MoEngage WebSDK loader snippet across all 13 integration sample files to the latest format. The new snippet adds versioned CDN URL support, a stricter data-center validation regex, an expanded API stubs list, and fixes the double-init guard to handle both US/UK spellings of "initialized".

Changes

  • Replace old IIFE with new snippet (regex DC validation, versioned CDN URL)
  • Add var sdkVersion = "2" to all integration files
  • Expand stub methods list with 18 new API methods (setLogLevel, identifyUser, etc.)
  • Fix double-init guard: check both initialized and initialised
  • Change app_id: to appId: in all moe() init calls
  • Migrate eu-cluster.html from legacy hardcoded webpush URL to DC-based format

Files Changed

index.html, self-handled-push.html, custom-serviceworker.html, web-personalization.html, debug.html, eu-cluster.html, angular-sample/src/index.html, react-sample/public/index.html, lg-web-os/index.html, samsung-tizen-os/samsungTizenOs/index.html, nuxt-spa/plugins/moe.js, nextjs/pages/_document.js, chrome-extension/popup.js

Tech Stack

Plain HTML/JS integration samples covering: Vanilla JS, Angular, React, Nuxt.js (SPA), Next.js, Chrome Extension, LG WebOS, Samsung Tizen OS — all integrating the MoEngage WebSDK via CDN loader snippet.

CSS Architecture

N/A — this PR contains no CSS changes.

Bundle Optimization

N/A — snippet changes are minimal (~41 insertions / 27 deletions). The new versioned CDN URL (/versions/2/) pins the SDK to a major version, avoiding unintended breaking updates.

Code Quality

  • All 13 files pass a 6-point validation matrix (new IIFE, sdkVersion, appId, versioned CDN, no old patterns)
  • No TypeScript or lint tooling applies to these static HTML/JS samples

Jira Ticket

WEB-273

Release Ticket

N/A

Test Cases

N/A

Testing Done

  • All 13 files validated: new IIFE, sdkVersion, appId, CDN URL, no old patterns
  • Manual browser test with a valid dc_X value

- Replace old IIFE loader with new version across 13 integration files
- Add sdkVersion variable and versioned CDN URL path
- Fix double-init guard to check both initialized/initialised spellings
- Expand stub methods list with 18 new API methods
- Change app_id to appId in all moe() init calls

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant