开发者社区> 镜像站> NPM> @adobe/asset-compute-events-client
@adobe/asset-compute-events-client
Adobe Asset Compute I/O Events Javascript Client
Last updated 7 months ago by tmathern .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @adobe/asset-compute-events-client 
SYNC missed versions from official npm registry.

Adobe Asset Compute I/O Events Javascript Client

Version

This is an internal library of the Adobe Asset Compute SDK. A simple Javascript/NodeJS client for using Adobe I/O Events.

Installation

npm install @adobe/asset-compute-events-client

Usage

Sending an event

const { AdobeIOEvents } = require('@adobe/asset-compute-events-client');

// setup using necessary credentials
const ioEvents = new AdobeIOEvents({
    // access token from an integration/technical account with I/O Events entitlement
    accessToken: "ey...",
    // organization sending/receiving events
    orgId: "6EEF12345678901234567890@AdobeOrg",

    defaults: {
        providerId: "my_event_provider_id"
    }
});

// send an event
return ioEvents.sendEvent({
    code: "my_event_type",
    payload: {
        hello: "world",
        date: new Date()
    }
});

Receiving events

const { AdobeIOEvents, AdobeIOEventEmitter } = require('@adobe/asset-compute-events-client');

// setup using necessary credentials
const ioEvents = new AdobeIOEvents({
    // access token from an integration/technical account with I/O Events entitlement
    accessToken: "access...",
});

// receiving events
const ioEventEmitter = new AdobeIOEventEmitter(ioEvents, 'http://journal-url');
ioEventEmitter.on('event', (event) => {
    // handle event
})
ioEventEmitter.on('error', (error) => {
    // report error
})

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

Current Tags

  • 1.0.1                                ...           latest (7 months ago)

2 Versions

  • 1.0.1                                ...           7 months ago
  • 1.0.0                                ...           7 months ago