npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@linwheel/sdk

v0.1.0

Published

TypeScript SDK for the LinWheel content engine API

Readme

@linwheel/sdk

TypeScript SDK for the LinWheel content engine API. Analyze, reshape, refine, and schedule LinkedIn content programmatically.

Zero runtime dependencies. Uses native fetch. Ships ESM + CJS with full type declarations.

Install

npm install @linwheel/sdk

Quick Start

import { LinWheel } from "@linwheel/sdk";

const lw = new LinWheel({ apiKey: "lw_sk_..." });

// Analyze content for LinkedIn potential
const analysis = await lw.analyze({ text: "Today I shipped a new SDK..." });
// → { linkedinFit: { score: 8 }, suggestedAngles: [...], recommendedPostCount: 3 }

// Reshape into angle-specific posts
const { posts } = await lw.reshape({
  text: "Today I shipped a new SDK...",
  angles: ["field_note", "contrarian"],
  saveDrafts: true,
});

// Refine a draft
const { refined } = await lw.refine({
  text: posts[0].text,
  intensity: "medium",
});

// Approve and schedule
await lw.posts.approve(postId, true);
await lw.posts.schedule(postId, {
  scheduledAt: "2026-02-24T09:00:00Z",
  autoPublish: true,
});

API Reference

Content Processing

// Analyze text for LinkedIn potential — topics, angles, fit score
const analysis = await lw.analyze({ text, context? });

// Reshape content through 7 angle lenses
const result = await lw.reshape({
  text,
  angles: ["field_note", "contrarian", "demystification", ...],
  preEdit?: boolean,       // light-edit input first
  instructions?: string,   // custom instructions
  saveDrafts?: boolean,    // persist as drafts
});

// Refine with parameterized intensity
const result = await lw.refine({
  text,
  intensity?: "light" | "medium" | "heavy",  // default: "medium"
  instructions?: string,
  postType?: string,       // target angle for tone
  saveDraft?: boolean,
});

// Split long content into a post series
const result = await lw.split({
  text,
  maxPosts?: number,       // 2-10, default 5
  instructions?: string,
  saveDrafts?: boolean,
});

Drafting

// Create a manual draft
const draft = await lw.draft({
  fullText: "Your post content...",
  hook?: string,
  postType?: string,        // default: "field_note"
  approved?: boolean,
  autoPublish?: boolean,
  scheduledAt?: string,     // ISO 8601
});

// Create a draft with image + carousel in one call
const bundle = await lw.bundle({
  fullText: "Your post content...",
  imageHeadlineText?: string,
  imageStylePreset?: "typographic_minimal" | "gradient_text" | "dark_mode" | "accent_bar" | "abstract_shapes",
  carouselSlides?: [{ headlineText: string, caption?: string }],
});

Post Management

// List posts with filters
const { posts } = await lw.posts.list({
  approved?: boolean,
  scheduled?: boolean,
  published?: boolean,
  type?: string,
  limit?: number,
  offset?: number,
});

// Get, update, approve, schedule
const post = await lw.posts.get(postId);
await lw.posts.update(postId, { fullText: "..." });
await lw.posts.approve(postId, true);
await lw.posts.schedule(postId, { scheduledAt: "2026-02-24T09:00:00Z" });

// Generate visuals
await lw.posts.image(postId, { headlineText: "...", stylePreset: "dark_mode" });
await lw.posts.carousel(postId, { slides: [...], stylePreset: "accent_bar" });

Voice Profiles

Voice profiles inject your writing style into all content generation. Provide writing samples and LinWheel matches your voice.

// Create a voice profile from your writing
const { profile } = await lw.voiceProfiles.create({
  name: "My Writing Voice",
  description: "Technical, direct, slightly irreverent",
  samples: [article1, article2, article3],
  isActive: true,
});

// List all profiles
const { profiles, activeProfileId } = await lw.voiceProfiles.list();

// Switch active profile
await lw.voiceProfiles.activate(profileId);

// Delete a profile
await lw.voiceProfiles.delete(profileId);

Configuration

const lw = new LinWheel({
  apiKey: "lw_sk_...",                           // required
  baseUrl: "https://www.linwheel.io",            // default
  signingSecret: "your-hmac-secret",             // optional, for request signing
  timeoutMs: 60_000,                             // default: 60s
});

HMAC Request Signing

If your API key has a signing secret, the SDK automatically signs every request with X-LW-Signature:

X-LW-Signature: t=<unix-seconds>,v1=<hmac-sha256-hex>

Canonical payload: <timestamp>.<METHOD>.<path>.<body-sha256>

Error Handling

import { LinWheelApiError, LinWheelAuthError } from "@linwheel/sdk";

try {
  await lw.analyze({ text: "..." });
} catch (e) {
  if (e instanceof LinWheelAuthError) {
    // 401 — invalid or missing API key
    console.error(e.message, e.responseBody);
  } else if (e instanceof LinWheelApiError) {
    // 4xx/5xx
    console.error(e.statusCode, e.message, e.responseBody);
  }
}

The 7 Content Angles

| Angle | What it does | |-------|-------------| | contrarian | Challenge conventional wisdom | | field_note | Share a specific observation from experience | | demystification | Break down something complex | | identity_validation | Make the reader feel seen | | provocateur | Be deliberately provocative | | synthesizer | Connect dots across domains | | curious_cat | Ask genuine questions |

License

MIT