TypeScript API client for interacting with Substack webservice
npm install substack-api



A modern, type-safe TypeScript client for the Substack API. Build newsletter automation, content management tools, and subscriber analytics with ease.
``bash`
pnpm add substack-api
`typescript
import { SubstackClient } from 'substack-api';
// Initialize client with your token
const client = new SubstackClient({
token: 'your-connect-sid-cookie-value',
publicationUrl: 'example.substack.com'
});
// Get your profile and iterate through posts
const profile = await client.ownProfile();
for await (const post of profile.posts({ limit: 5 })) {
console.log(š "${post.title}" - ${post.publishedAt?.toLocaleDateString()});
}
// Test connectivity
const isConnected = await client.testConnectivity();
``
š Complete Documentation ā
- Installation Guide - Setup and requirements
- QuickStart Tutorial - Get started in minutes
- API Reference - Complete method documentation
- Entity Model - Modern object-oriented API
- Examples - Real-world usage patterns
MIT