Troubleshooting the Discovery SDK
This guide covers the most common issues encountered when integrating the Discovery SDK, along with their causes and fixes.
1. Blank or Error Screen on Load
The SDK shows an error screen when required parameters are missing or malformed.
Check that all of the following are present in the iframe src URL:
accountIdselfRegistrationIdquestionPattern(must be 11, 17, or 46 exactly)firstnamelastnameemail
A missing or misspelled parameter will cause the SDK to fail at initialization. Double-check for typos, undefined values, and URL encoding issues, especially in email addresses containing special characters.
2. Subscription Key Not Transmitting
The SDK loads but the questionnaire does not proceed, or you receive an authentication error.
This is almost always caused by the postMessage call not firing correctly after the iframe loads.
Confirm the following:
- The
onloadhandler is attached to the iframe element before the iframe finishes loading. - The
messageTargetmatches the SDK base URL exactly:https://embeddiscovery.dnabehavior.com/ - The subscription key has been encrypted using the
jsencryptpackage before being passed. Passing a plain (unencrypted) key will fail silently. - The encryption key used is the one issued to your account. Using a placeholder or incorrect key is a common setup mistake.
If you are using a hosting platform like Vercel or Netlify, check whether outbound security headers are stripping or blocking the postMessage. This has been observed as a root cause in some deployments.
3. postMessage Not Working in React Native WebView
contentWindow.postMessage() does not function inside a React Native WebView. This is a known environment limitation, not an SDK bug.
Use injectJavaScript to pass the encrypted key after the iframe loads:
const injectKey = ` window.postMessage('${encryptedKey}', 'https://embeddiscovery.dnabehavior.com/'); true; `; webViewRef.current.injectJavaScript(injectKey);
Alternatively, use the WebView onMessage / postMessage bridge pattern specific to your React Native WebView library. Refer to your library's documentation for the correct implementation.
4. iframe Not Rendering in Next.js
If you are using Next.js with the App Router, the iframe will fail to render or the postMessage call will throw an error because it is executing server-side.
Fix: Wrap the SDK embed in a client component.
'use client';
Ensure the postMessage call is inside a useEffect hook so it only fires after the component mounts in the browser.
5. iframe Blocked by Content Security Policy
If your application enforces a Content Security Policy, the iframe may be blocked entirely.
Add the following to your CSP headers:
frame-src https://embeddiscovery.dnabehavior.com;
If you are also sending postMessage events, ensure your CSP does not block the origin.
6. User Cannot Retake the Questionnaire
Each email address in the DNA platform is treated as a unique record. Once a user completes a discovery under a given email, they cannot retake it under the same address.
If a user needs to retake the questionnaire (for example, upgrading from the 11-question model to the full 46-question discovery), they must use a different email address or an alias of the original.
This is by design and cannot be overridden at the integration level.
7. Progress Not Saving Between Sessions
The SDK automatically saves progress when a user exits mid-questionnaire. Progress resumes on the next login, provided the same email address is used.
If progress is not resuming, confirm that the email parameter being passed to the iframe is consistent across sessions for the same user. If your system generates or transforms email values dynamically, a mismatch will cause the SDK to treat returning users as new users.
8. Results Dashboard Not Displaying
If users complete the questionnaire but are not redirected to the dashboard, check whether you are listening for the screenChanged event.
If you have implemented a custom results UI, ensure your event listener is set up before the questionnaire completes. If the event fires before your listener is registered, you will miss the transition trigger.
9. Multiple Accounts Not Working Correctly
Each DNA account has its own API key. If your integration supports multiple accounts, each account requires its own set of credentials in your key vault: accountId, selfRegistrationId, and subscriptionKey.
Ensure your internal logic is mapping the correct credentials to the correct account before passing them to the iframe parameters. Mixing credentials across accounts will result in authentication failures or incorrect data being associated with the wrong account.
Still stuck?
Submit a support ticket here.
Include your accountId, a description of the issue, and any error messages or console output you are seeing.
Do not include your subscription key or encryption key in the ticket.