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

@pixeldojo/sdk

v0.1.0

Published

TypeScript SDK for the PixelDojo image and video generation API

Readme

@pixeldojo/sdk

TypeScript SDK for the PixelDojo image and video generation API.

Install

npm install @pixeldojo/sdk

Quick Start

import { PixelDojoClient } from '@pixeldojo/sdk';

const pd = new PixelDojoClient({ apiKey: 'pd_your_api_key' });

// Generate an image and wait for the result
const job = await pd.generate('flux-1.1-pro', {
  prompt: 'A fantasy castle on a cliff at sunset',
  aspect_ratio: '16:9',
});

console.log(job.assets[0].url);

Usage

List available models

const { models } = await pd.listModels();
const imageModels = await pd.listModels({ modality: 'image' });

Get model schema

const schema = await pd.getModelSchema('flux-1.1-pro');
console.log(schema.schema); // JSON Schema for the request body

Submit a job (async)

const submitted = await pd.run('flux-1.1-pro', {
  prompt: 'A sunset over the ocean',
  aspect_ratio: '1:1',
  webhook_url: 'https://example.com/webhook',
});

console.log(submitted.jobId);     // "job_abc123"
console.log(submitted.statusUrl); // poll URL

Poll for results

const job = await pd.getJob('job_abc123');

if (job.status === 'completed') {
  console.log(job.output?.images);
  console.log(job.assets);
}

Generate and wait (convenience)

const job = await pd.generate('wan-2.6-video', {
  prompt: 'Drone flight through coastal cliffs',
  duration: 6,
  aspect_ratio: '16:9',
}, {
  intervalMs: 3000,
  timeoutMs: 120_000,
  onStatusChange: (j) => console.log(`Status: ${j.status}`),
});

List recent jobs

const { jobs } = await pd.listJobs({ limit: 10, status: 'completed' });

Webhooks

// Check webhook delivery state
const state = await pd.getWebhookState('job_abc123');

// Replay a webhook for a completed/failed job
const replay = await pd.replayWebhook('job_abc123');

Error Handling

import {
  PixelDojoClient,
  InsufficientCreditsError,
  NotFoundError,
  TimeoutError,
} from '@pixeldojo/sdk';

try {
  const job = await pd.generate('flux-1.1-pro', { prompt: 'Hello' });
} catch (err) {
  if (err instanceof InsufficientCreditsError) {
    console.log(`Need ${err.required} credits, have ${err.available}`);
  } else if (err instanceof NotFoundError) {
    console.log('Model not found');
  } else if (err instanceof TimeoutError) {
    console.log(`Job ${err.jobId} timed out — you can still poll manually`);
  }
}

Configuration

const pd = new PixelDojoClient({
  apiKey: 'pd_your_api_key',
  baseUrl: 'https://pixeldojo.ai',  // default
  fetch: customFetchFn,              // optional, for testing or custom runtimes
});

API Reference

| Method | Description | |--------|-------------| | listModels(options?) | List all available models | | getModel(apiId) | Get model details including schema | | getModelSchema(apiId) | Get the JSON Schema for a model's request body | | run(apiId, input) | Submit a generation job (returns immediately) | | getJob(jobId) | Poll a job's status and results | | listJobs(options?) | List recent jobs for your API key | | getWebhookState(jobId) | Inspect webhook delivery status | | replayWebhook(jobId) | Replay webhook for completed/failed jobs | | generate(apiId, input, options?) | Submit + poll until complete |

License

MIT