0.7.6 • Published 4 months ago
@yext/chat-core v0.7.6
chat-core
a networking library for interacting with the Yext Chat API
- Works in both the browser and Node.js
- 100% TypeScript, with detailed request and response models
- Compatible with both CommonJS and ES6 imports
Usage
import { provideChatCore, StreamEventName, Message } from "@yext/chat-core";
const chatCore = provideChatCore({
botId: "YOUR_BOT_ID",
apiKey: "YOUR_API_KEY",
});
const messages: Message[] = [
{
source: "USER",
text: "What is Yext Chat?",
timestamp: "2023-05-15T17:33:38.373Z",
},
];
// Chat API
response = await chatCore.getNextMessage({ messages });
// Chat Streaming API
stream = await chatCore.streamNextMessage({ messages });
stream.addEventListener(StreamEventName.TokenStreamEvent, (event) =>
console.log("data", event.data)
);
stream.consume();
Documentation
See our documentation for a more details on supported API calls and interfaces.
0.7.6
4 months ago
0.7.5
6 months ago
0.7.0-alpha.23
8 months ago
0.7.2
7 months ago
0.5.4
9 months ago
0.7.1
7 months ago
0.5.3
10 months ago
0.7.4
6 months ago
0.7.3
7 months ago
0.5.5
9 months ago
0.5.0
10 months ago
0.7.0
8 months ago
0.6.1
9 months ago
0.5.2
10 months ago
0.6.0
9 months ago
0.5.1
10 months ago
0.4.1
10 months ago
0.4.0
10 months ago
0.4.2
10 months ago
0.3.3
11 months ago
0.3.2
11 months ago
0.3.1
11 months ago
0.3.0
11 months ago
0.2.0
12 months ago
0.1.0
12 months ago