@ambassify/eventbus-client
API Client for eventbus service
Last updated a month ago by ambassify .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ambassify/eventbus-client 
SYNC missed versions from official npm registry.

EventBus-client

A client to publish events to eventbus.

Installation

npm install --save eventbus-client

Usage

const { Client } = require('eventbus-client');
const eventbus = new Client({
    baseUrl: 'https://eventbus-endpoint'
});

eventbus.send('event_name', payload, options);

new EventBus()

new EventBus({ endpoint, [token, tokenType], [timeout] })
  • endpoint: The endpoint of the eventbus service.
  • token: The accessToken to use when none was set for the .send() call.
  • tokenType: The tokenType to use when setting the Authorization headerj.
  • timeout: The duration for which events are batched before publishing them.

.send()

.send(eventName, payload, options)
  • eventName: The event to publish. Example: item_created
  • payload: Any object that can be serialized using JSON.stringify
  • options: An object with any one of the following options set:
    • orgId: The organization ID to publish to.
    • userId: The user ID to publish to.
    • id: The ID of the object in payload
    • type: The type of the object in payload

Current Tags

  • 3.3.0                                ...           latest (a month ago)

25 Versions

  • 3.3.0                                ...           a month ago
  • 3.2.3                                ...           a month ago
  • 3.2.2                                ...           2 months ago
  • 3.2.1                                ...           3 months ago
  • 3.2.0                                ...           3 months ago
  • 3.1.2                                ...           3 months ago
  • 3.1.1                                ...           4 months ago
  • 3.1.0                                ...           4 months ago
  • 3.0.1                                ...           4 months ago
  • 3.0.0                                ...           6 months ago
  • 2.3.0                                ...           6 months ago
  • 2.2.0                                ...           8 months ago
  • 2.1.1                                ...           9 months ago
  • 2.1.0                                ...           9 months ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.6                                ...           a year ago
  • 1.2.5                                ...           a year ago
  • 1.2.4                                ...           a year ago
  • 1.2.3                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 54
Last Day 0
Last Week 0
Last Month 49
Dependencies (6)
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |