angularzendesk

Key is missing from snippet, Zendesk


Converting .NET webform to Angular 14. For this line

<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=12345"></script>

Implemented in TS:

ngOnInit(): void 
{
    let chatScript = document.createElement("script");
    chatScript.type = "text/javascript";
    chatScript.async = true;
    chatScript.src = 'https://static.zdassets.com/ekr/snippet.js?key=12345';  // Chrome complains here.
    document.body.appendChild(chatScript);
}

Chrome console got error:

Key is missing


Solution

  • Switching over to ngx-zendesk-webwidget, confirmed it's developed by Zendesk.