0.9.1 • Published 9 months ago

@yext/chat-core v0.9.1

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
9 months ago

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.9.1

9 months ago

0.9.0

11 months ago

0.8.1

11 months ago

0.8.2

11 months ago

0.8.0

1 year ago

0.7.6

1 year ago

0.7.5

2 years ago

0.7.0-alpha.23

2 years ago

0.7.2

2 years ago

0.5.4

2 years ago

0.7.1

2 years ago

0.5.3

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.5.5

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.5.2

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.2

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago