Skip to content

Commit 7874957

Browse files
Merge pull request #4 from sendbird/docs/update-readme
docs: update readme
2 parents 26d7bd6 + 1081467 commit 7874957

File tree

2 files changed

+27
-101
lines changed

2 files changed

+27
-101
lines changed

README.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# [Sendbird JavaScript Platform SDK](https://sendbird.com/docs/chat/v3/platform-api/getting-started/prepare-to-use-api)
44

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

78
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.
89
# Install
@@ -20,18 +21,22 @@ const apiToken = "YOUR_API_TOKEN";
2021
const appId = "YOUR_APP_ID";
2122

2223
const opts = {
23-
'createUserData': new SendbirdPlatformSdk.CreateUserData(userId, name, profileUrl),
24+
createAUserRequest: new SendbirdPlatformSdk.CreateAUserRequest(
25+
userId,
26+
name,
27+
profileUrl
28+
),
2429
};
2530

2631
async function createUser() {
27-
const userApiInstance = new SendbirdPlatformSdk.UserApi();
28-
userApiInstance.apiClient.basePath = `https://api-${appId}.sendbird.com`;
29-
try {
30-
const data = await userApiInstance.createUser(apiToken, opts);
31-
console.log(data);
32-
} catch (e) {
33-
console.log(e);
34-
}
32+
const userApiInstance = new SendbirdPlatformSdk.UserApi();
33+
userApiInstance.apiClient.basePath = `https://api-${appId}.sendbird.com`;
34+
try {
35+
const data = await userApiInstance.createAUser({apiToken, ...opts});
36+
console.log(data);
37+
} catch (e) {
38+
console.log(e);
39+
}
3540
}
3641

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

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

56+
57+
# 📦 Installation
58+
59+
You can install the SDK directly from npm:
60+
```
61+
# Using npm
62+
npm install sendbird-platform-sdk
63+
64+
# Using yarn
65+
yarn add sendbird-platform-sdk
66+
```
67+
> ⚠️ This SDK is intended for use in server-side environments only. Do not use it in browsers or frontend applications.
68+
5169
# 🤓 Local Development
5270

5371
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.
@@ -81,10 +99,8 @@ All the documentation for this project lives in the /docs directory of this repo
8199
| | Documentation |
82100
| ----------- | ----------- |
83101
| Announcement | [docs/AnnouncementApi.md](docs/AnnouncementApi.md)|
84-
| Application | [docs/ApplicationApi.md](docs/ApplicationApi.md) |
85102
| Bot | [docs/BotApi.md](docs/BotApi.md) |
86103
| GroupChannel | [docs/GroupChannelApi.md](docs/GroupChannelApi.md) |
87104
| Message | [docs/MessageApi.md](docs/MessageApi.md) |
88105
| OpenChannel | [docs/OpenChannelApi.md ](docs/OpenChannelApi.md) |
89106
| User | [docs/UserApi.md](docs/UserApi.md) |
90-
| Webhooks | [docs/WebhooksApi.md](docs/WebhooksApi.md) |

README.md-e

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)