Skip to content

Latest commit

 

History

History
95 lines (67 loc) · 2.25 KB

README.md

File metadata and controls

95 lines (67 loc) · 2.25 KB

DeBox Open SDK

DeBox Open SDK for Nodejs developers

License Total Downloads Version

English | 中文

Basic introduction

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.

Getting Started

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.


  1. Intall debox-open-sdk.
npm i debox-open-sdk

# or
pnpm add debox-open-sdk

# or
yarn add debox-open-sdk

  1. 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'

  1. 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',
})

  1. 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',
})