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

tryiton

v1.0.0

Published

Official JavaScript/TypeScript SDK for the TryItOn virtual try-on API.

Downloads

258

Readme

TryItOn Node.js SDK — AI Virtual Try-On API for JavaScript & TypeScript

Official Node.js and TypeScript client for the TryItOn virtual try-on API. Add photoreal AI virtual try-on for clothing, accessories, hairstyles, and tattoos to your JavaScript or TypeScript application with a few lines of code.

  • Virtual clothing try-on and accessory try-on (eyewear, footwear, headwear, jewelry)
  • Hairstyle and tattoo try-on
  • Fully typed, zero runtime dependencies (uses the native fetch API)
  • Built-in job polling helper

Full API reference: docs.tryiton.now · Get an API key: tryiton.now/app/developer

Installation

npm install tryiton

Requires Node.js 18 or later (or any runtime with a global fetch, such as Bun, Deno, or modern browsers). TypeScript types are bundled.

Quickstart: run a virtual try-on

Submit a garment and a model photo, then wait for the generated result image.

import { TryItOn } from "tryiton";

const client = new TryItOn({ apiKey: process.env.TRYITON_API_KEY });

// Submit a clothing try-on
const jobId = await client.tryOnClothes({
  modelImage: "https://example.com/model.jpg",
  garmentImage: "https://example.com/tshirt.jpg",
  category: "clothing",
  subcategory: "tops",
});

// Poll until the job completes and return the output image URL(s)
const [resultUrl] = await client.waitForResult(jobId);
console.log(resultUrl); // CDN URL, available for 72 hours

Image inputs accept a public URL or a base64 data URL (data:image/png;base64,...).

Core parameters

tryOnClothes covers clothing and accessory try-on. The most important parameters:

| Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | modelImage | string | Yes | URL or base64 data URL of the person. | | garmentImage | string | Yes | URL or base64 data URL of the garment or accessory. | | category | string | No | Item type: auto, clothing, eyewear, footwear, headwear, jewelry, accessories, or others. auto detects it for you. | | subcategory | string | No | Required for clothing (tops, bottoms, dresses), jewelry, and accessories. |

Additional options (mode and moderationLevel for clothing; numSamples 1–4 and outputFormat png/jpeg for every try-on, including hairstyle and tattoo) are documented in the API reference.

Other endpoints

// Hairstyle try-on (see the HAIRCUTS export for all supported values)
await client.tryOnHairstyle({ faceImage, haircut: "BuzzCut", hairColor: "ash blonde" });

// Tattoo try-on
await client.tryOnTattoo({ bodyImage, designImage, placement: "on the right forearm, small" });

// Poll a job manually, or check your credit balance
const status = await client.getStatus(jobId);   // { status, output, error }
const credits = await client.getCredits();        // { on_demand, subscription, purchased, reserved }

Error handling

All failures throw TryItOnError, which carries the HTTP status code and the API error name.

import { TryItOn, TryItOnError } from "tryiton";

try {
  await client.tryOnClothes({ /* ... */ });
} catch (err) {
  if (err instanceof TryItOnError) {
    console.error(err.status, err.errorName, err.message); // e.g. 429, "OutOfCredits"
  }
}

Notes

  • Output image URLs expire 72 hours after completion. Download any results you want to keep.
  • Failed jobs are never charged.

Documentation

Full documentation, parameter reference, and guides: docs.tryiton.now

License

MIT