0.0.27 • Published 7 months ago
@agent-embed/react v0.0.27
Install
npm install @agent-embed/reactStandard
import { Standard } from '@agent-embed/react'
const App = () => {
return (
<Standard
agentName="my-agent"
style={{ width: '100%', height: '600px' }}
/>
)
}This code is creating a container with a 100% width (will match parent width) and 600px height.
Popup
import { Popup } from '@agent-embed/react'
const App = () => {
return <Popup agentName="my-agent" autoShowDelay={3000} />
}This code will automatically trigger the popup window after 3 seconds.
Open or Close a popup
You can use these commands:
import { open } from '@agent-embed/react'
open()import { close } from '@agent-embed/react'
close()import { toggle } from '@agent-embed/react'
toggle()Bubble
import { Bubble } from '@agent-embed/react'
const App = () => {
return (
<Bubble
agentName="my-agent"
previewMessage={{
message: 'I have a question for you!',
autoShowDelay: 5000,
avatarUrl: 'https://avatars.githubusercontent.com/u/16015833?v=4',
}}
theme={{
button: { backgroundColor: '#0042DA', iconColor: '#FFFFFF' },
previewMessage: { backgroundColor: '#ffffff', textColor: 'black' },
}}
/>
)
}This code will show the bubble and let a preview message appear after 5 seconds.
Open or close the preview message
You can use these commands:
import { showPreviewMessage } from '@agent-embed/react'
Agent.showPreviewMessage()import { hidePreviewMessage } from '@agent-embed/react'
Agent.hidePreviewMessage()Open or close the chat window
You can use these commands:
import { open } from '@agent-embed/react'
open()import { close } from '@agent-embed/react'
close()import { toggle } from '@agent-embed/react'
toggle()0.0.22
8 months ago
0.0.23
8 months ago
0.0.24
8 months ago
0.0.25
7 months ago
0.0.18
10 months ago
0.0.19
9 months ago
0.0.26
7 months ago
0.0.27
7 months ago
0.0.17
1 year 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.1.1
2 years ago