@adobe/api-client-decisioning
v0.0.3
Published
Adobe Decisioning Service API Client for NodeJS
Downloads
12
Readme
api-client-decisioning
Adobe Decisioning Service API client for NodeJS/Javascript
Goals
A robust, straightforward API client for building applications on top of the Decisioning Service in Javascript/NodeJS. This client can be used both server & client side.
This package is build upon adobe-fetch which handles the low level API call, JWT authentication, token caching and storage.
Installation
npm install --save @adobe/api-client-decisioning
Common Usage
This package exposes 2 separate clients:
- Offers - CRUD operations on the Offer object modules. This client calls APIs under /data/core/xcore.
- ODE - Offer Decisioning Engine. This client calls APIs under /data/core/ode.
Instantiation
- Option A - Provide an adobefetch instance:
const { Offers, ODE } = require('@adobe/api-client-decisioning');
const config = {
auth: { ... See adobe/fetch documentation for details ... }
};
const adobefetch = require('@adobe/fetch').config(config);
const ode = new ODE(adobefetch, { containerId: MY_CONTAINER_ID });
const offers = new Offers(adobefetch, { containerId: MY_CONTAINER_ID });
const allActivities = await offers.getActivities();
- Option B - Provide the auth configuration, adobefetch will be instantiated automatically:
const { Offers, ODE } = require('@adobe/api-client-decisioning');
const ode = new ODE(adobefetch, {
auth: { ... See adobe/fetch documentation for details ... },
containerId: MY_CONTAINER_ID
});
const offers = new Offers(adobefetch, {
auth: { ... See adobe/fetch documentation for details ... },
containerId: MY_CONTAINER_ID
});
const allActivities = await offers.getActivities();
More information about Decisioning APIs.
- Manage Decisioning Objects
- Using the Decisioning Service runtime
- ODE API Spec
- Offers Core Objects API Spec
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.