@yourrentals/cloudevent-publisher-core
v0.7.2
Published
This library defines a JS library to publish messages to the message bus.
Downloads
299
Keywords
Readme
@yourrentals/cloudevent-publisher-core
This library defines a JS library to publish messages to the message bus.
Installation
yarn add @yourrentals/cloudevent-publisher-core
Usage
import { Publisher } from '@yourrentals/cloudevent-publisher-core';
const publisher = new Publisher({
source: 'publisher',
topics: [
{
eventType: 'my-event',
topicArn: 'arn:aws:sns:eu-west-1:123456789012:my-topic',
},
],
});
await publisher.publish('my-event', {
data: {
foo: 'bar',
},
});
await publisher.publishBatch('my-event', [
{
data: {
foo: 'bar',
},
},
]);