Skip to content

alterego-labs/remark-api-client-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RemarkAPI Client for Node.js apps

There are a lot of RemarkApp related projects that are written by node.js. But there is one common API for all of them. So this repo contains node.js package which provides common gateway to access Remark API.

Install

To install this package, please, run the next command in the terminal:

$ npm install alterego-labs/remark-api-client-node --save

Usage

Login

To be able to make requests to the login endpoint add the following line into the file in which you want to do that:

import { AuthApiGateway } from 'remark-api-client-node';

And then you can run request and process responses something like this:

AuthApiGateway.login({ login: 'SomeUser001' })
  .then((response_json) => {
    Store.dispatch(receiveAccessToken(response_json.data.user));
    return response_json;
  }).catch(function(error) {
    var response_json = error.response;
    this.setState({ errors: response_json.data.errors });
  });

Send push token

Import appropriate class:

import { UsersApiGateway } from 'remark-api-client-node';

Example of the common usage:

UsersApiGateway.sendPushToken('sergio', {
  type: 'android', value: 'asdsada'
});

About

Library for Node.js projects to access Remark API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors