grafana/public/app/core/services/echo/utils.ts
Ashley Harrison d61bcdf4ca
Chore: Pass signed user_hash to Intercom via Rudderstack (#63921)
* move analytics identifiers to backend

* implement hash function

* grab secret from env

* expose and retrieve intercom secret from config

* concat email with appUrl to ensure uniqueness

* revert to just using email

* Revert "revert to just using email"

This reverts commit 8f10f9b1bc.

* add docstring
2023-03-03 14:39:53 +00:00

18 lines
490 B
TypeScript

import { attachDebugger, createLogger } from '@grafana/ui';
export function loadScript(url: string, async = false) {
return new Promise((resolve) => {
const script = document.createElement('script');
script.onload = resolve;
script.src = url;
script.async = async;
document.head.appendChild(script);
});
}
/** @internal */
export const echoLogger = createLogger('EchoSrv');
export const echoLog = echoLogger.logger;
attachDebugger('echo', undefined, echoLogger);