Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# [Sendbird JavaScript Platform SDK](https://sendbird.com/docs/chat/v3/platform-api/getting-started/prepare-to-use-api)

[![link to docs](https://img.shields.io/badge/SDK-docs-green)](/docs)
[![NPM](https://img.shields.io/npm/v/sendbird-platform-sdk.svg)](https://www.npmjs.com/package/sendbird-platform-sdk)

This is a Node.js package that makes talking to the [Sendbird Platform API](https://sendbird.com/docs/chat/v3/platform-api/getting-started/prepare-to-use-api) easier. With this library you can extend your Sendbird integration to include advanced features like channel automation and user management.
# Install
Expand All @@ -20,18 +21,22 @@ const apiToken = "YOUR_API_TOKEN";
const appId = "YOUR_APP_ID";

const opts = {
'createUserData': new SendbirdPlatformSdk.CreateUserData(userId, name, profileUrl),
createAUserRequest: new SendbirdPlatformSdk.CreateAUserRequest(
userId,
name,
profileUrl
),
};

async function createUser() {
const userApiInstance = new SendbirdPlatformSdk.UserApi();
userApiInstance.apiClient.basePath = `https://api-${appId}.sendbird.com`;
try {
const data = await userApiInstance.createUser(apiToken, opts);
console.log(data);
} catch (e) {
console.log(e);
}
const userApiInstance = new SendbirdPlatformSdk.UserApi();
userApiInstance.apiClient.basePath = `https://api-${appId}.sendbird.com`;
try {
const data = await userApiInstance.createAUser({apiToken, ...opts});
console.log(data);
} catch (e) {
console.log(e);
}
}

createUser();
Expand All @@ -48,6 +53,19 @@ In order to make requests with this SDK you will need you master API token. This

You will need [Node.js](https://nodejs.org/en/download/) installed. This has been developed and tested with NodeJS 17+.


# 📦 Installation

You can install the SDK directly from npm:
```
# Using npm
npm install sendbird-platform-sdk

# Using yarn
yarn add sendbird-platform-sdk
```
> ⚠️ This SDK is intended for use in server-side environments only. Do not use it in browsers or frontend applications.

# 🤓 Local Development

To run locally we need to make use of the [npm link](https://docs.npmjs.com/cli/v8/commands/npm-link) command. You will require two terminal tabs.
Expand Down Expand Up @@ -81,10 +99,8 @@ All the documentation for this project lives in the /docs directory of this repo
| | Documentation |
| ----------- | ----------- |
| Announcement | [docs/AnnouncementApi.md](docs/AnnouncementApi.md)|
| Application | [docs/ApplicationApi.md](docs/ApplicationApi.md) |
| Bot | [docs/BotApi.md](docs/BotApi.md) |
| GroupChannel | [docs/GroupChannelApi.md](docs/GroupChannelApi.md) |
| Message | [docs/MessageApi.md](docs/MessageApi.md) |
| OpenChannel | [docs/OpenChannelApi.md ](docs/OpenChannelApi.md) |
| User | [docs/UserApi.md](docs/UserApi.md) |
| Webhooks | [docs/WebhooksApi.md](docs/WebhooksApi.md) |
90 changes: 0 additions & 90 deletions README.md-e

This file was deleted.