@nuskin/ns-contentstack-lib
v1.1.0
Published
This project contains configuration, runconfig transition, and api code to access Contentstack, to be shared between the backend (AWS Lambda) and frontend (Vue, etc).
Downloads
9
Keywords
Readme
@nuskin/ns-contentstack-lib
This project contains configuration, runconfig transition, and api code to access Contentstack, to be shared between the backend (AWS Lambda) and frontend (Vue, etc).
Installing
Usng npm:
npm install @nuskin/ns-contentstack-lib
Usng yarn:
yarn add @nuskin/ns-contentstack-lib
Example usage
const { ContentstackApi } = require('@nuskin/ns-contentstack-lib')
// WARNING: this config should come from app/user configuration
const apiKey = "<API Key>";
const deliveryToken = "<Delivery Token>";
const language = "en";
const configData = {
apiKey: "<API Key>",
deliveryToken: "<Delivery Token>",
language: "en" // "en", "en-gb", etc.
};
let contentstackApi = new ContentstackApi(configData);
const entries = await contentstackApi.getEntries("market");
Resources
- https://code.tls.nuskin.io/ns-am/utility/npm/ns-contentstack-lib