1.0.1 • Published 10 months ago

centri-agent v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

CentriAgent

Install

npm install centri-agent

How 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 {}

all types are sync with latests Centrifugo api docs (currently v5) you can find in

https://centrifugal.dev/docs/server/server_api#http-api

1.0.1

10 months ago

1.0.0

10 months ago