🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

jscent

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscent

Node.js client to interact with the Centrifugo HTTP API

0.2.1
latest
Source
npm
Version published
Weekly downloads
5
-44.44%
Maintainers
1
Weekly downloads
 
Created
Source

Node.js library for Centrifugo HTTP API.

Installation

You need to be running Node.js 0.8+ to use this library.

$ npm install jscent

Usage

var Client = require('jscent');

var client = new Client({
  url: 'http://localhost:8000',
  secret: 'SECRET_KEY'
});

Methods of the Client take an optional callback as the last argument. After performing the request, the callback is called with 2 arguments:

  • error - if the request can't be performed or returns an error code, error will contain details, otherwise it will be null
  • response - the response object

All operational errors are wrapped into a Client.RequestError object.

generating a token

to create a token as described here: https://fzambia.gitbooks.io/centrifugal/content/clients/javascript.html#token-required

var Token = require('jscent').Token;

var TokenGen = new Token('SECRET_KEY');
var token = TokenGen.clientToken(user, timestamp, info);

Keywords

centrifugo

FAQs

Package last updated on 02 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts