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

@nudity/api

v1.0.2

Published

Client for the Undress API.

Readme

Nudity API SDK for JavaScript/TypeScript

A high-performance, strictly typed client for the Nudity API. This SDK allows you to integrate image generation, video animation, and face swap technologies into your applications with ease. Built with native Fetch, it is optimized for Bun, Node.js (18+), and modern browser environments.

Core Concepts: The Asynchronous Workflow Most operations in this API (Undressing, Animation, Face Swap) are resource-intensive and process asynchronously.

Request: You submit a task with required media and a webhook URL.

Queue: The API returns a idGen (Task ID) immediately.

Processing: The server processes your request in the background.

Callback: Once finished, the API sends an HTTP POST request containing the result URL to your specified webhook.

Installation

# Using Bun (Recommended)
bun add @nudity/api

# Using NPM
npm install @nudity/api

Quick Start

Initialize the Client

import { NudityApi } from '@nudity/api';
// Initialize with your API token
const client = new NudityApi('your_api_token_here');

Image Generation (Undress) This method requires a webhook to receive the final image.

const response = await client.image.generate({
  image: Bun.file('./input.jpg'), // Supports BunFile, Blob, or File
  cloth: 'Bikini',
  webhook: 'https://your-backend.com/api/callback',
  idGen: 'internal_tracking_id_001'
});
console.log(`Task queued: ${response.idGen}`);

API Reference

The SDK is organized into domain-specific resources:

client.image:

  • generate(params): Submits an image processing task.

  • getPosition(idGen): Checks the current queue status and result.

  • getCollections(): Fetches available style collections.

client.video

  • animate(params): Converts a static image into a video.

  • getPosition(idGen): Polls video generation status.

  • getModels(): Lists available animation models.

client.swap

  • generate(params): Initiates a face swap (Image/Video).

  • getPosition(idGen): Polls status for swap tasks.

client.profile

  • getBalance(): Returns current account credit balance.

Handling Webhooks (Best Practices)

To receive results from the API, your server must expose a public POST endpoint.

Example Express/NestJS logic:

  • Your server receives a POST request from the API.
  • The body contains the idGen and the url of the generated asset.
  • You map this idGen to a user in your database and notify them.

Tip: During development, use tools like ngrok or webhook.site to inspect incoming results.

Error Handling The SDK throws descriptive errors for failed requests.

try {
  const balance = await client.profile.getBalance();
} catch (error) {
  // error.message will contain: "NudityApi Error [401]: Unauthorized"
  console.error(error.message);
}```