0.0.7-dev.0 • Published 3 months ago
@revium/gpt-widget v0.0.7-dev.0
Quickstart
cp .env.example .env.local
yarn
yarn dev
Deploy code
<script>
function loadScript(url, callback) {
let script = document.createElement('script')
script.type = 'text/javascript'
script.src = url
script.onload = callback
document.head.appendChild(script)
let link = document.createElement('link')
link.rel = 'stylesheet'
link.href = 'https://cdn.jsdelivr.net/npm/@revium/gpt-widget@0.x.x/dist/style.css'
document.head.appendChild(link)
}
// Function to initialize the widget after the script is loaded
function initializeWidget() {
if (typeof ReviumGptWidget !== 'undefined' && typeof ReviumGptWidget.init === 'function') {
ReviumGptWidget.init({
source: 'xxxxxxxx',
apikey: 'xxxxxxxx',
intro:
'Im an AI chatbot built by the Revium team and trained on data you can find on this site, ask me anything about the website or future privacy laws!',
textMode: 'light',
primaryColor: '#000000',
secondaryColor: '#000000',
elementId: 'revium-gpt-widget',
})
} else {
console.error('ReviumGptWidget is not defined or does not have an init() function.')
}
}
// Load the external script
loadScript('https://cdn.jsdelivr.net/npm/@revium/gpt-widget@0.x.x/dist/revium-gpt-widget.js', initializeWidget)
</script>
Minified
function loadScript(t,e){let i=document.createElement("script");i.type="text/javascript",i.src=t,i.onload=e,document.head.appendChild(i);let n=document.createElement("link");n.rel="stylesheet",n.href="https://cdn.jsdelivr.net/npm/@revium/gpt-widget@0.x.x/dist/style.css",document.head.appendChild(n)}function initializeWidget(){"undefined"!=typeof ReviumGptWidget&&"function"==typeof ReviumGptWidget.init?ReviumGptWidget.init({source:"xxxxxxxx",apikey:"xxxxxxxx",intro:"Im an AI chatbot built by the Revium team and trained on data you can find on this site, ask me anything about the website or future privacy laws!",textMode:"light",primaryColor:"#000000",secondaryColor:"#000000"}):console.error("ReviumGptWidget is not defined or does not have an init() function.")}loadScript("https://cdn.jsdelivr.net/npm/@revium/gpt-widget@0.x.x/dist/revium-gpt-widget.js",initializeWidget);
0.0.21
3 months ago
0.0.22-dev.0
3 months ago
0.0.23-dev.0
3 months ago
0.0.21-dev.0
4 months ago
0.0.20
5 months ago
0.0.20-dev.0
5 months ago
0.0.19-dev.0
5 months ago
0.0.15
6 months ago
0.0.14
6 months ago
0.0.18-dev.0
6 months ago
0.0.17-dev.0
6 months ago
0.0.16-dev.0
6 months ago
0.0.15-dev.0
6 months ago
0.0.14-dev.0
6 months ago
0.0.13
6 months ago
0.0.13-dev.0
6 months ago
0.0.12
6 months ago
0.0.12-dev.0
6 months ago
0.0.11
6 months ago
0.0.10
6 months ago
0.0.8-dev.0
7 months ago
0.0.7-dev.0
7 months ago
0.0.6
7 months ago
0.0.6-dev.0
7 months ago
0.0.5
7 months ago
0.0.5-dev.0
7 months ago
0.0.4
7 months ago
0.0.4-dev.0
7 months ago
0.0.3
7 months ago
0.0.2
7 months ago
0.0.1
7 months ago