@openquok/node-sdk
v0.0.2
Published
The Openquok programmatic API SDK
Maintainers
Readme
[!NOTE] This package is a lightweight Node.js client for Openquok’s programmatic API (
/api/v1/public/*). You authenticate using an API key (or OAuth app token) in theAuthorizationheader. You can find the full backend codebase atOpenquok 's bakend
What Is It For
@openquok/node-sdk helps you automate Openquok 's social scheduling from Node.js:
- Create/schedule posts via the programmatic API
- List posts / manage post groups
- Upload media (multipart) for use in posts
- Manage programmatic integrations (list, connect URL, delete)
It’s intentionally small: just a typed wrapper around the HTTP endpoints.
Quickstart
Installation
npm install @openquok/node-sdkQuick Guide
import Openquok from "@openquok/node-sdk";
const openquok = new Openquok("YOUR_API_KEY", {
// optional (defaults shown)
baseUrl: "https://api.openquok.com",
apiPrefix: "/api/v1",
});
// Upload a file (multipart field name: `file`)
const uploaded = await openquok.upload(fileBuffer, "png");
// Create a scheduled post
await openquok.post({
scheduledAt: new Date().toISOString(),
status: "scheduled",
body: "Hello from Openquok SDK",
media: uploaded?.data?.filePath ? [{ id: "1", path: uploaded.data.filePath }] : undefined,
});The available methods are:
upload(file: Buffer, extension: string)- Upload media viaPOST {apiPrefix}/public/uploadpost(body: PublicCreatePostDto)- Create/schedule posts viaPOST {apiPrefix}/public/postspostList(filters: PublicListPostsQueryDto)- List posts viaGET {apiPrefix}/public/posts/listgetPostGroup(postGroup: string)- Get a post group viaGET {apiPrefix}/public/posts/group/:postGroupupdatePostGroup(postGroup: string, body: PublicUpdatePostGroupDto)- Update a post group viaPUT {apiPrefix}/public/posts/group/:postGroupdeletePostGroup(postGroup: string)- Delete a post group viaDELETE {apiPrefix}/public/posts/group/:postGroupintegrations()- Get a list of connected channels viaGET {apiPrefix}/public/integrationsdeleteIntegrationChannel(id: string)- Delete a connected channel viaDELETE {apiPrefix}/public/integrations/:id
Alternatively you can use the API with curl — check out our docs.
