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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tech314/reson8r-publisher-sdk

v1.0.0

Published

Official Reson8r SDK for publishers to integrate AI-powered content generation and article updates

Readme

@reson8r/publisher-sdk

Official Reson8r SDK for publishers to integrate AI-powered content generation and article updates into their websites and CMS.

Installation

npm install @reson8r/publisher-sdk
# or
yarn add @reson8r/publisher-sdk
# or
pnpm add @reson8r/publisher-sdk

Quick Start

1. Onboard Your Publisher Account

import { PublisherOnboarding } from '@reson8r/publisher-sdk';

const onboarding = new PublisherOnboarding({
  supabaseUrl: 'https://your-supabase-url.supabase.co',
  supabaseKey: 'your-service-role-key',
});

// Register publisher and site
const result = await onboarding.completeOnboarding(
  {
    name: 'Your Publisher Name',
    email: '[email protected]',
    website: 'https://yourpublisher.com',
    description: 'Your publisher description',
  },
  {
    domain: 'yourpublisher.com',
    name: 'Your Site Name',
    category: 'news',
  }
);

if (result.success) {
  console.log('Publisher ID:', result.publisherId);
  console.log('Site ID:', result.siteId);
  console.log('API Key:', result.apiKey);
}

2. Generate Articles

import { ArticleGenerator } from '@reson8r/publisher-sdk';

const generator = new ArticleGenerator({
  orchestratorUrl: 'https://reson8r-backend.bcweiss.workers.dev/api/v1/ghostwriter/orchestration',
  apiKey: 'your-api-key',
});

// Generate a new article
const result = await generator.generate({
  keyword: 'AI content generation',
  category: 'technology',
  qualityTier: 'standard', // or 'premium' or 'elite'
  publishImmediately: false,
});

if (result.success) {
  console.log('Article generated!');
  console.log('Word count:', result.metrics?.wordCount);
  console.log('Quality score:', result.metrics?.qualityScore);
  
  // Save to your CMS
  const article = await saveToCMS({
    title: 'Generated Article Title',
    content: generator.formatContentForCMS(content, 'html'),
    status: 'draft',
  });
}

3. Update Existing Articles

import { ArticleUpdater } from '@reson8r/publisher-sdk';

const updater = new ArticleUpdater({
  orchestratorUrl: 'https://reson8r-backend.bcweiss.workers.dev/api/v1/ghostwriter/orchestration',
  apiKey: 'your-api-key',
});

// Update an existing article
const result = await updater.update({
  articleUrl: 'https://yourpublisher.com/articles/existing-article',
  qualityTier: 'premium',
});

if (result.success) {
  console.log('Article updated!');
  console.log('Words added:', result.summary?.wordsAdded);
  console.log('Style score:', result.summary?.styleScore);
  
  // Get the updated content
  const status = await updater.getStatus(result.runId);
  const updatedContent = updater.applyPatches(
    originalContent,
    status.patch.edits
  );
}

API Reference

Reson8rClient

Core client for interacting with the Reson8r orchestrator API.

import { Reson8rClient } from '@reson8r/publisher-sdk';

const client = new Reson8rClient({
  orchestratorUrl: 'https://reson8r-backend.bcweiss.workers.dev/api/v1/ghostwriter/orchestration',
  apiKey: 'your-api-key',
});

// Run orchestration
const result = await client.runOrchestration({
  url: 'https://yoursite.com/articles/article-slug',
  options: {
    forceRun: true,
    qualityTier: 'standard',
  },
});

// Get history
const history = await client.getHistory('url-id', 10);

// Get status
const status = await client.getStatus('run-id');

// Health check
const isHealthy = await client.healthCheck();

ArticleGenerator

High-level API for generating new articles.

import { ArticleGenerator } from '@reson8r/publisher-sdk';

const generator = new ArticleGenerator({
  orchestratorUrl: '...',
  apiKey: '...',
});

const result = await generator.generate({
  keyword: 'your-keyword',
  category: 'your-category',
  qualityTier: 'standard' | 'premium' | 'elite',
  publishImmediately: false,
});

// Format content for different CMS systems
const htmlContent = generator.formatContentForCMS(content, 'html');
const markdownContent = generator.formatContentForCMS(content, 'markdown');

ArticleUpdater

High-level API for updating existing articles.

import { ArticleUpdater } from '@reson8r/publisher-sdk';

const updater = new ArticleUpdater({
  orchestratorUrl: '...',
  apiKey: '...',
});

const result = await updater.update({
  articleUrl: 'https://yoursite.com/articles/slug',
  qualityTier: 'premium',
});

// Apply patches to content
const updatedContent = updater.applyPatches(
  originalContent,
  result.patch.edits
);

PublisherOnboarding

Streamlined onboarding for new publishers.

import { PublisherOnboarding } from '@reson8r/publisher-sdk';

const onboarding = new PublisherOnboarding({
  supabaseUrl: '...',
  supabaseKey: '...',
});

// Complete onboarding
const result = await onboarding.completeOnboarding(
  publisherInfo,
  siteInfo
);

// Get SDK snippet
const snippet = onboarding.getSDKSnippet(siteId);

Framework Integration

Next.js

// app/api/ghostwriter/generate/route.ts
import { ArticleGenerator } from '@reson8r/publisher-sdk';
import { NextResponse } from 'next/server';

export async function POST(request: Request) {
  const generator = new ArticleGenerator({
    apiKey: process.env.RESON8R_API_KEY,
  });

  const body = await request.json();
  const result = await generator.generate(body);

  return NextResponse.json(result);
}

Express.js

import express from 'express';
import { ArticleGenerator } from '@reson8r/publisher-sdk';

const app = express();
const generator = new ArticleGenerator({
  apiKey: process.env.RESON8R_API_KEY,
});

app.post('/api/generate', async (req, res) => {
  const result = await generator.generate(req.body);
  res.json(result);
});

Quality Tiers

  • standard: Fast, cost-effective (Llama 4 Scout) - Default
  • premium: Higher quality (Qwen3 235B)
  • elite: Best quality, long context (Llama 4 Maverick)

Error Handling

try {
  const result = await generator.generate(options);
  if (!result.success) {
    console.error('Generation failed:', result.error);
  }
} catch (error) {
  console.error('Unexpected error:', error);
}

TypeScript Support

Full TypeScript support with comprehensive type definitions.

import type {
  Reson8rConfig,
  ArticleGenerationOptions,
  GenerationResult,
} from '@reson8r/publisher-sdk';

Examples

See the Publisher Integration Guide for framework-specific examples and CMS integrations.

Support

  • Documentation: https://github.com/weissbc07/reson8r-engine
  • Issues: https://github.com/weissbc07/reson8r-engine/issues
  • API Health: https://reson8r-backend.bcweiss.workers.dev/health

License

MIT