Nerdy People Matriculate

    sendbird-platform-sdk

    1.0.3 • Public • Published

    Sendbird banner image

    Sendbird JavaScript Platform SDK

    link to docs

    This is a Node.js package that makes talking to the Sendbird Platform API easier. With this library you can extend your Sendbird integration to include advanced features like channel automation and user management.

    Install

    npm install sendbird-platform-sdk

    🔥 Quick start

    import SendbirdPlatformSdk from 'sendbird-platform-sdk';
    
    const userId = "1234";
    const name = "bob";
    const profileUrl = "https://picsum.photos/200";
    
    const opts = {
        'apiToken': 'YOUR_MASTER_API_KEY',
        'createUserData': new SendbirdPlatformSdk.CreateUserData(userId, name, profileUrl),
    };
    
    async function createUser() {
        const userApiInstance = new SendbirdPlatformSdk.UserApi();
        userApiInstance.apiClient.basePath = `https://api-${"YOUR_APP_ID"}.sendbird.com`;
        try {
            const data = await userApiInstance.createUser(opts);
            console.log(data);
        } catch (e) {
            console.log(e);
        }
    }
    
    createUser();

    ⚠️ Warnings

    1. This package is not currently in npm. Please see the Local development section for installation instructions.

    2. This library is intended for server to server requests. Do not use in a browser environment. This SDK uses the Master API Token, which should never be exposed to the outside world like in a webpage or app.

    ⚒️ Prerequisite

    In order to make requests with this SDK you will need you master API token. This can be found through the Sendbird dashboard. Each app you create in Sendbird has its own master api token. These tokens can be found in Settings > Application > General.

    how to find you api token

    💻 Requirements

    You will need Node.js installed. This has been developed and tested with NodeJS 17+.

    🤓 Local Development

    To run locally we need to make use of the npm link command. You will require two terminal tabs.

    Please follow these steps:

    Terminal 1
    1. Clone this repo to your machine git clone git@github.com:sendbird/sendbird-platform-sdk
    2. Move into the newly cloned repo cd sendbird-platform-sdk
    3. Install node modules npm install
    4. Build the bundled JS npm run build
    5. Link the package npm link
    Terminal 2
    1. Create a new npm package or move into and existing one mkdir app-using-sendbird-chat npm init -y
    2. Link package to sendbird-platform-sdk npm link path/to/sdk/sendbird-platform-sdk

    The linking step is demonstrated visually here.

    npm link walkthrough

    🗃️ Documentation

    All the documentation for this project lives in the /docs directory of this repo.

    Helpful links
    Documentation
    Announcements docs/AnnouncementsApi.md
    Application docs/ApplicationApi.md
    BotInterface docs/BotInterfaceApi.md
    GroupChannel docs/GroupChannelApi.md
    Messages docs/MessagesApi.md
    OpenChannel docs/OpenChannelApi.md
    User docs/UserApi.md
    Webhooks docs/UserApi.md

    Keywords

    none

    Install

    npm i sendbird-platform-sdk

    DownloadsWeekly Downloads

    33

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    2.45 MB

    Total Files

    320

    Last publish

    Collaborators

    • sendbird