@adobe/api-client-decisioning
Adobe Decisioning Service API Client for NodeJS
Last updated a year ago by ibaratz .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @adobe/api-client-decisioning 
SYNC missed versions from official npm registry.

License Version Downloads/week Build Status codecov Greenkeeper badge Language grade: JavaScript

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.

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

  • 0.0.3                                ...           latest (a year ago)

1 Versions

  • 0.0.3                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |