npm.io
1.1.0 • Published 5 years ago

@nuskin/ns-contentstack-lib

Licence
ISC
Version
1.1.0
Deps
2
Size
15 kB
Vulns
25
Weekly
0

@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

License

MIT