@guching/admin-api
v1.0.0-alpha.6
Published
Halo admin api client.
Downloads
83
Maintainers
Readme
Installation
npm install @halo-dev/admin-api --save
Usage
Here is a simple code for obtaining a list of articles.
import { AdminApiClient, HaloRestAPIClient } from "@halo-dev/admin-api";
// http request tool for halo rest api.
const haloRestApiClient = new HaloRestAPIClient({
baseUrl: process.env.HALO_BASE_URL,
auth: { adminToken: "halo admin token" },
});
// create adminApiClient by haloRestApiCLient.
const haloAdminClient = new AdminApiClient(haloRestApiClient);
// obtaining a list of articles.
haloAdminClient.post.list().then((res) => {
console.log(res);
});
Specific use example reference example