centri-agent
v1.0.1
Published
Client to communicate with Centrifugo HTTP API server
Downloads
7
Readme
CentriAgent
Install
npm install centri-agentHow To use
Simple, Just import and create Agent then call what method you want:
import { CentriAgent } from 'centri-agent';
const CentrifugoConfig = {
url: process.env.CENTRI_HOST || '',
key: process.env.CENTRI_KEY || '',
};
const client = new CentriAgent(CentrifugoConfig.url, CentrifugoConfig.key);
// call method
const { channels } = await client.channels({ pattern: "*" });
console.log(channels);
//=> [{"channelA", "channelB"}]Hint : methods args without any request parameters need to pass {}
