1.0.0 • Published 2 years ago

@biocadless/api v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Use API SDK in NodeJS project:

Before install app run npm install @biocadless/api | yarn add @biocadless/api

import ApiSDK from "@biocadless/api"

const config = {
	app_key: "my-app-key",
	app_secret: "my-app-secret"
}
const api = new ApiSDK(config)

const terms = await api.terms.list({ taxonomy: "category-1" })
console.log(terms)

const post = await api.posts.single({ slug: "my-post-slug" })
console.log(post)

const newPost = await api.posts.create({
	title: "My New Post",
	content: "This is the content of my new post"
})
console.log(newPost)

const updatedPost = await api.posts.update(1234, {
	title: "My Updated Post",
	content: "This is the updated content of my post"
})
console.log(updatedPost)

await api.posts.delete(5678)
console.log("Post deleted")
1.0.0

2 years ago