Javascript SDK
Installation and Setup
Node.js: Download and install from nodejs.org.
Install the SDK:
npm install posto-sdkImporting the SDK:
import { PostoSDK } from 'posto-sdk';
Initializing the SDK
Create an instance using your authentication token:
import { PostoSDK } from 'posto-sdk';
const posto = PostoSDK.fromToken("YourBase64EncodedAuthToken");Parameter:
token— Your authentication token.
Posting Messages
The post method lets you publish text messages, with or without media, and even schedule posts.
Basic Post
Parameter:
to— A channel ID, an array of IDs, or a channel name.
Post with Media and Scheduling
Parameters:
media: Specifies the media file.when: Can be a relative time (e.g., "30m", "2h"), a Date object, a Unix timestamp, or a human-readable string.
Scheduling Posts and Campaigns
Scheduling a Single Post
Schedule a post for a specific future time:
Creating a Campaign
Schedule a series of posts (a campaign) over time:
Quick Campaign
For a simplified campaign setup:
Default Settings and Saved Styles
Setting Default Configurations
Network-wide Defaults:
Channel-specific Defaults:
Saved Styles
Saving a Style:
Retrieving a Style:
Listing All Styles:
Channel and Network Management
Fetching Channels:
Network Settings: Retrieve and update settings for a specific network:
Schedule Management
Manage your scheduled posts with these methods:
List Schedules:
Retry Schedules:
Delete Schedules:
Proxies should be used on all accounts that are using cookies to connect the accounts. If connecting via apps then proxies are not needed.
Last updated