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.

💡
New to InkWell?
Start with our Quick Start Guide to get your first article published in under 5 minutes.

Installation

Install the InkWell SDK via your preferred package manager:

bash
# 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:

javascript
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
⚠️
Draft vs Published
Posts with 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:

javascript
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:

javascript
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:

Response headers include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.

Best Practice
Implement exponential backoff in your retry logic. The SDK does this automatically for 429 responses.

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.

← Installation Quick Start →