Introduction to InkWell
A modern, developer-friendly content publishing platform designed for speed, scalability, and seamless integration.
InkWell provides a robust REST API and SDK for publishing, managing, and distributing blog content at scale. Whether you're building a personal blog, a corporate newsroom, or a multi-author platform, InkWell handles the heavy lifting so you can focus on content.
Installation
Install the InkWell SDK via your preferred package manager:
# Using npm
npm install @inkwell/sdk
# Using yarn
yarn add @inkwell/sdk
# Using pnpm
pnpm add @inkwell/sdk
Quick Start
Initialize the client and publish your first article:
import { InkWell } from '@inkwell/sdk';
const inkwell = new InkWell({
apiKey: process.env.INKWELL_API_KEY,
environment: 'production'
});
async function publishFirstPost() {
const post = await inkwell.posts.create({
title: 'Hello, InkWell!',
slug: 'hello-inkwell',
content: '# Welcome to InkWell\n\nThis is my first post using the InkWell SDK.',
status: 'published',
category: 'announcements'
});
console.log('Published:', post.id);
}
publishFirstPost();
Configuration
InkWell can be configured via environment variables or programmatically. The SDK automatically handles retries, caching, and request signing.
| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string | Required | Your project API key from the dashboard |
environment |
string | 'production' |
'sandbox' or 'production' |
timeout |
number | 10000 |
Request timeout in milliseconds |
retries |
number | 3 |
Automatic retry attempts on failure |
API: Posts
The Posts API allows you to create, update, delete, and query articles. All endpoints support pagination and filtering.
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/posts |
List all published posts |
| POST | /v1/posts |
Create a new post |
| GET | /v1/posts/:id |
Retrieve a specific post |
| POST | /v1/posts/:id |
Update an existing post |
| GET | /v1/posts/:id/revisions |
View post version history |
status: 'draft' are not publicly accessible. Only 'published' posts are indexed and cached by CDNs.SDK Usage Patterns
The InkWell SDK follows a fluent interface and supports both callback and Promise-based workflows.
Batch Operations
Use batch.create() for efficient multi-post operations:
const results = await inkwell.batch.create([
{ title: 'Post 1', content: 'Content 1', status: 'published' },
{ title: 'Post 2', content: 'Content 2', status: 'draft' },
{ title: 'Post 3', content: 'Content 3', status: 'published' }
]);
console.log(results.successCount); // 3
console.log(results.errors); // []
Stream Processing
For large datasets, use the stream API to avoid memory spikes:
const stream = inkwell.posts.stream({
limit: 10000,
filters: { category: 'tech', published_after: '2024-01-01' }
});
for await (const post of stream) {
await processContent(post);
}
Rate Limits
Inkwell implements rate limiting to ensure platform stability. Limits are enforced per API key:
- Standard: 1,000 requests/minute, 100,000 requests/day
- Pro: 10,000 requests/minute, 1,000,000 requests/day
- Enterprise: Custom limits based on SLA
Response headers include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.
FAQ
How do I handle markdown to HTML conversion?
InkWell automatically renders markdown during content delivery. You can also use the /v1/render endpoint to preview HTML before publishing.
Can I customize the public URL structure?
Yes. Use slug_patterns in your project configuration to define dynamic routing like /:category/:year/:slug.
Is the SDK TypeScript compatible?
Absolutely. Full type definitions are included in the package. IntelliSense and strict type checking work out of the box.