Socket
Socket
Sign inDemoInstall

@yext/chat-core

Package Overview
Dependencies
8
Maintainers
111
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @yext/chat-core

Typescript Networking Library for the Yext Chat API


Version published
Weekly downloads
696
decreased by-3.87%
Maintainers
111
Install size
732 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 26 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc