DeBox Open SDK for Nodejs developers
English | 中文
This project is the Nodejs programming interface of Debox social chat service (Chat Service) API, the encapsulation and implementation of Chat Service Rest API, to help Nodejs developers program and use Debox's chat message service faster.
Open platform provides Nodejs language version SDK (Software Development Kit)
Nodejs SDK encapsulates all API interfaces of DeBox services, and you can easily call all API interfaces of related services through Nodejs SDK.
- Intall
debox-open-sdk
.
npm i debox-open-sdk
# or
pnpm add debox-open-sdk
# or
yarn add debox-open-sdk
- Once you install
debox-open-sdk
You need to be clear whether you use commonjs or es modules. This SDK supports both, you can refer to the following example to use.
// Commonjs
const { Client } = require('debox-open-sdk')
// ES modules
import { Client } from 'debox-open-sdk'
- Next, you can initialize a client instance with your api key and some custom configurations
const data = new Client({
endpoint: 'https://open.debox.pro',
apiKey: 'your-api-key',
})
- The following APIs are currently supported, and more functions will be added in the future.
- Register callback address
const res = await data.sendChatMsg({
registerUrl: 'your receive message url address'
httpMethod: 'your receive message http method'
})
- send conversation message
const res = await data.sendChatMsg({
toUserId: '',
groupId: 'groupId',
message: 'Hello World',
})
- get groupId
const res = await data.getGroupId({
inviteUrl: 'https://debox.site/group/00021pru',
})