Giter VIP home page Giter VIP logo

sendbird-nodejs's Introduction

sendbird-nodejs

Thin wrapper around SendBird Server REST API

PLEASE NOTE THIS WORKS ON TOP OF SENDBIRD V2.0 API - V3.0 WILL COME SOON

Installation

npm install sendbird-nodejs --save

Usage

See SendBird Documentation for payload and response details.
You don't need to pass the auth field on the payload, you provide it when creating a new instance of SendBird and it is attached to all requests.

var SendBird = require('sendbird-nodejs');
var sb = new SendBird(config.sendBird.appToken);

The sb instance we just created has a field for each endpoint in the SendBird Server API that is an object with the endpoints methods.
sb.user
sb.channel
sb.messaging
sb.admin
sb.migration

So, to create a user you would simply need to have something like this:

var payload = {
    "id": string,                 // User ID
    "nickname": string,           // User nickname
    "image_url": string,          // User profile image URL
    "issue_access_token": boolean // Default is false. Use only if you want to create an access token for this user
};
sb.user.create(payload)
    .then(function (response) {
        // do something with SendBird response    
    });

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

sendbird-nodejs's People

Contributors

kfiroo avatar

Watchers

James Cloos avatar camus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.