New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dify-chat

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dify-chat

dify-chat

latest
Source
npmnpm
Version
0.2.3
Version published
Maintainers
1
Created
Source

dify-chat

yarn add dify-chat -D
import { ChatClient } from 'dify-chat'

const client = new ChatClient({
  baseURL: '/dify/v1',
  apiKey: 'app-xxxxx'
})

client.sendChatMessage({
  query: 'hi dify',
  user: 'github'
}, {
  onData: (res) => {
    console.log('onData-> ', res)
  },
  onMessageEnd: (res) => {
    console.log('onMessageEnd-> ', res)
  },
  onMessageReplace: (res) => {
    console.log('onMessageReplace-> ', res)
  },
  onNodeStarted: (res) => {
    console.log('onNodeStarted-> ', res)
  },
  onNodeFinished: (res) => {
    console.log('onNodeFinished-> ', res)
  },
  onWorkflowStarted: (res) => {
    console.log('onWorkflowStarted-> ', res)
  },
  onWorkflowFinished: (res) => {
    console.log('onWorkflowFinished-> ', res)
  },
  onCompleted: (res) => {
    console.log('onCompleted-> ', res)
  },
  onError: (res) => {
    console.log('onError-> ', res)
  }
})

API

import { ChatClient } from 'dify-chat'

const client = new ChatClient({
  baseURL: '/dify/v1',
  apiKey: 'app-xxxxx'
})

client.tts({
  text: 'hello hello' 
}).then((blob) => {
  const audioUrl = URL.createObjectURL(blob);
  const audio = new Audio(audioUrl);
  audio.play();
})

References

https://github.com/langgenius/webapp-conversation

Keywords

dify

FAQs

Package last updated on 26 Aug 2025

Did you know?

Socket

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