License registered for a different bundle identifier

You might see the following license error: NutrientError: Failed to initialize NutrientViewer: Invalid license key. Failed to activate NutrientViewer for 'example.domain'. Error: Your license has been registered for a different bundle identifier - not "example.domain". Each NutrientViewer license is only valid for one explicit bundle ID and one distribution method (Enterprise or public App Store). Please contact sales at https://www.nutrient.io/contact-sales with your requirements for a new license.

This error can be caused when you have both `example.domain` and `www.example.domain` licensed. Since you’re using the same license key for both domains, it can cause the error to happen intermittently, depending on whether the visitor uses `www.example.domain`.
<div class="alert alert-neutral-gray alert-single-line"> <div class="icon-container"> <!-- Render the SVG element with the computed attributes and content --><svg aria-hidden="true" fill="currentColor" viewBox="0 0 24 24" width="24" height="24" class data-astro-cid-3i7l2dmc style="--icon-color: currentColor;">
<path fill="currentColor" d="M12 5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm1 4a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-1 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-2-7a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm5 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/>
</svg> <!-- Define styles for the SVG element with the provided color and size --> </div> <div class="text-container"> <div>
Safari simplifies the domain that’s shown to you, so unless you click the address bar to show the full URL, it might show you `example.domain/`, even though it’s accessing `www.example.domain`. </div> </div> </div>
To make sure you’re loading the correct license key based on the domain your users are visiting, use something like the following:
```js
let licenseKey = null;
if (document.location.host === "example.domain") {
licenseKey = "<insert license key for example.domain>";
} else if (document.location.host === "www.example.domain") {
licenseKey = "<insert license key for www.example.domain>";
} else {
console.error("Invalid location -> escalate to ops");
}

We’re working on improving this error message so it’s clearer.

Additionally, it’s generally recommend to use a web app on only one subdomain — either www or no subdomain — as this can reduce potential problems. Refer to this page for more information(opens in a new tab).