Socket
Book a DemoInstallSign in
Socket

@nuskin/cs-rest-api

Package Overview
Dependencies
Maintainers
6
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuskin/cs-rest-api

Wraper around the Contentstack REST API to make using it in Javascript easier for Nu Skin.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-66.67%
Maintainers
6
Weekly downloads
 
Created
Source

@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

// Get latest published entry for Common English
let entry = await delivery.getEntry('product', 'uid')

// Get latest saved entry for US-en
entry = await management.getEntry('product', 'uid', 'US-en')

// Publish an entry
const res = await management.publishEntry(localizedKit.uid, ['en'], ['public-dev'])

License

MIT

FAQs

Package last updated on 08 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts