cms-publisher-sdk
v1.0.3
Published
this is library for get the post
Downloads
213
Readme
CMS-PUBLISHER-SDK
CMS-PUBLISHER-SDK is a Javascript library for getting posts.
Installation
Use the node package manager [npm] to install library.
npm install cms-publisher-sdk
Usage
import CMSPublisherSDK, { Config } from "cms-publisher-sdk";
const url = "https://url.com.vn"; //examples url
const apiKey = "this-is-api-key"; //the key get from website cms publisher
const sdk = new CMSPublisherSDK(apiKey, url);
//Get a post
sdk.getPost(postId).then((post) => {
//...
});
//Get list post with paging
const config: Config = {
page: 0,
size: 10,
sort: "createdAt,desc",
};
sdk.getPosts(config).then((posts) => {
//...
});