Skip to content

Instantly share code, notes, and snippets.

@meyt
Created April 7, 2022 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meyt/257c26bb08c4ee143709ed237d4608fe to your computer and use it in GitHub Desktop.
Save meyt/257c26bb08c4ee143709ed237d4608fe to your computer and use it in GitHub Desktop.
raychat nuxt plugin
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