0.0.27 • Published 7 months ago
@agent-embed/nextjs v0.0.27
Install
npm install @agent-embed/nextjs
Bubble
import { Bubble } from '@agent-embed/nextjs'
const App = () => {
return (
<Bubble
agentName="agent-name"
theme={{ button: {
backgroundColor: "#2b3e13",
} }}
previewMessage={{
message: 'Sounds Interesting? Use the chatbot to sign up!',
}}
/>
)
}
This code will show the bubble and let a preview message appear after 5 seconds.
You can also use the Script
component in NextJs as below:
import Script from 'next/script'
<Script
src="https://cdn.jsdelivr.net/npm/@agent-embed/js@0.0.1/dist/web.js"
strategy="afterInteractive"
type="module"
onLoad={() => {
Agent.initBubble({
agentName: "agent-name",
theme: {
button: { backgroundColor: "#2b3e13" },
},
});
}}
/>
Open or close the preview message
You can use these commands:
import { showPreviewMessage } from '@agent-embed/nextjs'
Agent.showPreviewMessage()
import { hidePreviewMessage } from '@agent-embed/nextjs'
Agent.hidePreviewMessage()
Open or close the chat window
You can use these commands:
import { open } from '@agent-embed/nextjs'
open()
import { close } from '@agent-embed/nextjs'
close()
import { toggle } from '@agent-embed/nextjs'
toggle()
0.0.22
7 months ago
0.0.23
7 months ago
0.0.24
7 months ago
0.0.25
7 months ago
0.0.18
10 months ago
0.0.19
8 months ago
0.0.26
7 months ago
0.0.27
7 months ago
0.0.17
12 months ago
0.0.16
1 year ago
0.0.10
1 year ago
0.0.11
1 year ago
0.0.12
1 year ago
0.0.13
1 year ago
0.0.14
1 year ago
0.0.15
1 year ago
0.0.9
1 year ago
0.0.8
1 year ago
0.0.5
1 year ago
0.0.7
1 year ago
0.0.6
1 year ago
0.0.4
1 year ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago