JavaScript SDK
Official JavaScript SDK for seamless integration with Universal Blog Platform.
Quick Installation
Get started with the JavaScript SDK in minutes
npm install @universal-blog-platform/sdkBasic Usage
Initialize the SDK
import { UniversalBlogPlatform } from '@universal-blog-platform/sdk';
const ubp = new UniversalBlogPlatform({
apiKey: 'your-api-key',
baseURL: 'https://api.universalblogplatform.com'
});Create a Post
const post = await ubp.posts.create({
title: 'My First Post',
content: 'This is the content of my post',
platforms: ['twitter', 'linkedin'],
scheduledAt: new Date('2024-12-25T10:00:00Z')
});Get Analytics
const analytics = await ubp.analytics.get({
postId: 'post-id',
dateRange: {
start: '2024-12-01',
end: '2024-12-31'
}
});SDK Features
TypeScript support
Promise-based API
Automatic retries
Error handling
Rate limiting
Webhook support