@nuskin/cs-rest-api
This library is used to perform functions using the Contentstack REST APIs. There are some cases where using the REST APIs are necessary inside Nu Skin (product data for example), so this library facilitates making those calls.
Functions that use the delivery token are under the delivery object, and functions using the management token are under the management object.
Installing
Usng npm:
npm add @nuskin/cs-rest-api
Usng yarn:
yarn add @nuskin/cs-rest-api
Example usage
const { csRestApi } = require('@nuskin/cs-rest-api')
const api = csRestApi({
apiKey: 'api_key',
managementToken: 'management_token',
deliveryToken: 'delivery_token'
})
const {management, delivery} = api
let entry = await delivery.getEntry('product', 'uid')
entry = await management.getEntry('product', 'uid', 'US-en')
const res = await management.publishEntry(localizedKit.uid, ['en'], ['public-dev'])
License
MIT