posthog-js icon indicating copy to clipboard operation
posthog-js copied to clipboard

Toolbar not loading or displaying - TypeError: posthog.loadToolbar is not a function

Open lukyncze opened this issue 2 years ago • 0 comments

I have issue with displaying toolbar. I tried this without any success. Now I am getting this error: TypeError: posthog.loadToolbar is not a function.

I used JS snippet in index.html (Angular app): https://posthog.com/docs/getting-started/install?tab=snippet#add-to-your-website--app

My code:

posthog.init('MY_CREDENTIALS', { api_host: 'https://app.posthog.com' });

const toolbarJSON = new URLSearchParams(window.location.hash.substring(1)).get('__posthog')

if (toolbarJSON) {
    posthog.loadToolbar(JSON.parse(toolbarJSON))
}

lukyncze avatar Jun 28 '23 13:06 lukyncze