Problem: Errors when initializing the SDK or “ReachSDK is not defined”.Solutions:
Copy
// Wait for script to load before initializingconst script = document.createElement('script');script.src = 'https://cdn.embedreach.com/iframe/sdk/sdk.es.js';script.async = true;script.onload = () => { // Only initialize after script has loaded const sdk = new window.ReachSDK(config);};document.body.appendChild(script);
Certain web frameworks, including React/Next.js, can make it easy to
accidentally initialize the SDK multiple times.
A full example of the SDK implementation can be found here. If you continue to experience issues, contact our support team at
support@embedreach.com with: