@postsider/node version 2.x. Each entry documents the signature, parameters, return value, and a usage example. For installation and setup, see the SDK Overview.
SDK 2.0.0 changed
deletePost() to return the parsed response body (or null for a 204) instead of the raw fetch Response. Failed calls throw PostsiderApiError with status and details. See the Changelog.post, postList, upload, integrations, deletePost, and webhook signature verification. For queue slots, status changes, analytics, groups, notifications, and import-from-URL, call the REST API directly.
new Postsider(apiKey, instanceUrl?, options?)
Creates a new client. Instantiate it once and reuse it.The instance origin. Pass
https://api.postsider.com for Cloud or your self-hosted origin. Do not rely on a package default because Cloud and OSS releases may differ. The SDK appends /public/v1 after the configured path prefix.client.post(posts)
Creates a post. Maps toPOST /public/v1/posts.
The post configuration.
now publishes immediately, schedule books the post for date, draft saves without publishing.Promise<unknown[]> - an array with one entry per target channel: { postId, integration }. The full post is available via the REST API afterwards.
client.postList(filters)
Lists posts in a date range. Maps toGET /public/v1/posts.
Returns:
Promise<{ posts: Post[] }>.
client.upload(file, extension)
Uploads a media file. Maps toPOST /public/v1/upload. The SDK handles multipart encoding and MIME type mapping.
Promise<object> with the media id and path. Pass the object straight into a post’s image array.
client.integrations()
Lists connected channels. Maps toGET /public/v1/integrations.
Promise<Channel[]>, each with id, name, identifier, profile, picture, and disabled.
client.deletePost(id)
Deletes a post by id. Maps toDELETE /public/v1/posts/:id.
null for an empty response. Errors throw PostsiderApiError with the HTTP status and request details.
Postsider.verifyWebhookSignature(signature, body, secret)
Static method. Verifies a timestamped HMAC SHA-256 signature on an inboundpost.published webhook before you process it. Use it only when the delivery includes the signature and timestamp headers. It uses a timing-safe comparison and rejects timestamps older than five minutes by default.
The X-Postsider-Signature header value is formatted as sha256=<hex-digest>.
The exact raw request body as a string or buffer converted to UTF-8. Do not re-serialize a parsed JSON object; key order or whitespace changes invalidate the signature.
The
X-Postsider-Timestamp header value. The signature covers timestamp + "." + rawBody.boolean, true if the signature is valid. Always reject requests that return false.

