@adobe/asset-compute-events-client

1.2.1 • Public • Published

⚠️ DISCLAIMER ⚠️

This is an internal project. It is only meant to be used by asset-compute-commons.

For Adobe App Builder applications and other components needing to use I/O Events, please use the aio-lib-events library.


Adobe Asset Compute I/O Events Javascript Client

Version License Travis

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
})

IO Events API: https://www.adobe.io/apis/experienceplatform/events/ioeventsapi.html

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.

Dependencies (5)

Dev Dependencies (12)

Package Sidebar

Install

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

Weekly Downloads

114

Version

1.2.1

License

Apache-2.0

Unpacked Size

52.4 kB

Total Files

11

Last publish

Collaborators

  • dylandepass
  • djaeggi
  • adobehalls
  • fullcolorcoder
  • marbec
  • tripod
  • garthdb
  • lazd
  • adobe-admin
  • patrickfulton
  • trieloff
  • shazron
  • krisnye
  • dcpfsdk
  • natebaldwin
  • devongovett
  • aspro83
  • symanovi
  • dpfister
  • stefan-guggisberg
  • korra
  • rofe
  • kptdobe