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

printpal

v1.0.1

Published

Official JavaScript/TypeScript client for PrintPal 3D Model Generation API - Convert images to 3D models for 3D printing

Readme


Why PrintPal?

  • Image to 3D - Transform any image into a printable 3D model
  • Text to 3D - Generate 3D models from text descriptions
  • Multiple Quality Levels - From fast previews to ultra-high resolution
  • 3D Printing Ready - Export directly to STL, OBJ, GLB, and more
  • Texture Support - Generate models with full color textures
  • TypeScript Native - Full type definitions included

Installation

npm install printpal
yarn add printpal
pnpm add printpal

Quick Start

import { PrintPal, Quality } from 'printpal';

// Initialize client
const client = new PrintPal({
  apiKey: 'pp_live_your_api_key_here',
});

// Generate a 3D model from an image (simplest method)
const outputPath = await client.generateAndDownload(
  './photo.png',
  './model.stl',
  { quality: Quality.SUPER }
);

console.log(`3D model saved to: ${outputPath}`);

Getting Your API Key

  1. Create an account at printpal.io
  2. Navigate to API Keys
  3. Click "Create New API Key"
  4. Copy your key (starts with pp_live_)

Quality Levels

| Quality | Resolution | Credits | Time | Best For | |---------|------------|---------|------|----------| | DEFAULT | 256 cubed | 4 | ~20s | Quick previews | | HIGH | 384 cubed | 6 | ~30s | Better detail | | ULTRA | 512 cubed | 8 | ~60s | High quality | | SUPER | 768 cubed | 20 | ~3min | Professional | | SUPER_TEXTURE | 768 cubed | 40 | ~6min | With colors | | SUPERPLUS | 1024 cubed | 30 | ~4min | Maximum detail | | SUPERPLUS_TEXTURE | 1024 cubed | 50 | ~12min | Best quality |

Output Formats

| Format | Extension | Best For | |--------|-----------|----------| | STL | .stl | 3D printing (default) | | GLB | .glb | Web, games, textures | | OBJ | .obj | Wide compatibility | | PLY | .ply | Point clouds | | FBX | .fbx | Animation (super only) |

Usage Examples

Basic Generation

import { PrintPal, Quality, Format } from 'printpal';

const client = new PrintPal({ apiKey: 'pp_live_...' });

// Generate and download in one call
const path = await client.generateAndDownload(
  './image.png',
  './output.stl',
  {
    quality: Quality.SUPER,
    format: Format.STL,
    onProgress: (status) => console.log(status.status),
  }
);

High-Resolution with Texture

const path = await client.generateAndDownload(
  './product.png',
  './product.glb',
  {
    quality: Quality.SUPERPLUS_TEXTURE,
    format: Format.GLB,
  }
);

Text to 3D

const result = await client.generateFromPrompt({
  prompt: 'A cute robot character',
  quality: Quality.HIGH,
  format: Format.GLB,
});

const path = await client.waitAndDownload(
  result.generationUid,
  './robot.glb'
);

Async Workflow (More Control)

// Step 1: Submit generation
const result = await client.generateFromImage('./photo.png', {
  quality: Quality.SUPER,
});

console.log(`Generation UID: ${result.generationUid}`);
console.log(`Credits used: ${result.creditsUsed}`);

// Step 2: Poll for completion
const status = await client.waitForCompletion(result.generationUid, {
  pollInterval: 5000,
  onProgress: (s) => console.log(`Status: ${s.status}`),
});

// Step 3: Download
const downloadInfo = await client.getDownloadUrl(result.generationUid);
const path = await client.download(result.generationUid, './model.stl');

Check Credits

const credits = await client.getCredits();
console.log(`Balance: ${credits.credits} credits`);

Generate from Buffer

import * as fs from 'fs';

const imageBuffer = fs.readFileSync('./photo.png');

const result = await client.generateFromBuffer(
  imageBuffer,
  'photo.png',
  { quality: Quality.HIGH }
);

Error Handling

import {
  PrintPal,
  PrintPalError,
  AuthenticationError,
  InsufficientCreditsError,
  TimeoutError,
} from 'printpal';

try {
  const path = await client.generateAndDownload('./image.png');
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Invalid API key');
  } else if (error instanceof InsufficientCreditsError) {
    console.error(`Need ${error.creditsRequired} credits, have ${error.creditsAvailable}`);
  } else if (error instanceof TimeoutError) {
    console.error('Generation timed out');
  } else if (error instanceof PrintPalError) {
    console.error(`API error: ${error.message}`);
  }
}

API Reference

Client Methods

| Method | Description | |--------|-------------| | generateFromImage(path, options) | Generate 3D from image file | | generateFromBuffer(buffer, name, options) | Generate 3D from image buffer | | generateFromPrompt(options) | Generate 3D from text prompt | | generateAndDownload(path, output, options) | Generate and download in one call | | getStatus(uid) | Get generation status | | waitForCompletion(uid, options) | Wait for generation to complete | | getDownloadUrl(uid) | Get pre-signed download URL | | download(uid, path) | Download completed model | | waitAndDownload(uid, path, options) | Wait and download | | getCredits() | Get credit balance | | getPricing() | Get pricing information | | getUsage() | Get usage statistics | | healthCheck() | Check API health |

Configuration

const client = new PrintPal({
  apiKey: 'pp_live_...',      // Required
  baseUrl: 'https://...',     // Optional, default: https://printpal.io
  timeout: 60000,             // Optional, request timeout in ms
});

Use Cases

  • E-commerce - Create 3D product previews from photos
  • Gaming - Generate 3D assets from concept art
  • Education - Convert diagrams to 3D models
  • Architecture - Transform sketches to 3D mockups
  • Manufacturing - Rapid prototyping from images
  • Art & Design - Bring 2D art to life in 3D

Requirements

Links

License

MIT License - see LICENSE for details.