Created
April 7, 2022 02:34
-
-
Save meyt/257c26bb08c4ee143709ed237d4608fe to your computer and use it in GitHub Desktop.
raychat nuxt plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function () { | |
if (process.env.NODE_ENV !== 'production') return | |
const i = '<CLIENT_KEY>' | |
const w = window | |
const l = w.localStorage.getItem('rayToken') | |
const g = document.createElement('script') | |
g.async = true | |
g.src = 'https://app.raychat.io/scripts/js/' + i + '?href=' + w.location.href | |
if (l) g.src += '&rid=' + l | |
document.getElementsByTagName('head')[0].appendChild(g) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment