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

socaity

v0.0.17

Published

SDK for Generative AI. Build AI-powered applications with ease

Readme

Introduction

The Socaity TypeScript SDK simplifies integration with Socaity.ai, a leading platform for AI-powered content generation, including text-to-image, text-to-speech, face swapping, chat models, and more.

With a lightweight footprint (UMD ~25KB, ES ~30KB), this SDK lets you seamlessly interact with Socaity's hosted AI models using simple, intuitive API calls.

A complete list of all models can be found here.

🚀 Why Use the Socaity SDK?

  • One-liner AI calls – No need to handle raw API requests.
  • Asynchronous & performant – Optimized for parallel processing.
  • Supports multiple AI models – Text, images, voice cloning, deep fakes, virutal avatars and more.
  • File handling included – Upload/download images with ease.
  • Works with Node.js & Browser – Supports ES modules and UMD builds.

Installation

Install via npm:

npm install socaity

Quick Start

🔑 Import the SDK

import { socaity } from "socaity";
socaity.setApiKey('sk...'); // we recommend settting the API key with environment variables. 

Register and get your API key

💬 AI Chat with SOTA LLMs Models

This will use the SOTA DeepSeek-R1 to create your response.

const response = await socaity.chat("Explain why an SDK is better than direct API calls.");

To use a different model like llama3 just add a second parameter as model name.

🖼️ Generate an AI Image

const images = await socaity.text2img("A futuristic city at sunset", "flux-schnell", { num_outputs: 1 });
await images[0].save("output/futuristic_city.jpg");

🗣️ Text-To-Speech

const audio = await socaity.text2voice("Hello, welcome to Socaity!");
await audio.save("output/welcome_message.mp3");

🎤 Voice-Cloning

Use two audio-files and copy the voice of the source to the other one. Internally this will create an embedding first.

const clonedVoice = await socaity.voice2voice("data/input_voice.mp3", "data/source_voice.mp3");
await clonedVoice.save("output/cloned_voice.mp3");

Or do it more efficient by creating and reusing an embedding by leveraging the power of SpeechCraft.

import { SpeechCraft } from 'socaity'

// create embedding
const speechCraft = new SpeechCraft();
const embedding = await speechCraft.voice2embedding("data/source_voice.mp3");
await embedding.save("output/source_embedding.npz");

// reuse embedding
const clonedVoice = await speechCraft.voice2voice("data/input_voice.mp3", "output/source_embedding.npz");
await clonedVoice.save("output/cloned_voice.mp3");

🖼️ Face Swapping and DeepFakes

const result = await socaity.swapImg2Img("data/source.jpg", "data/target.jpg");
await result.save("output/face_swap.jpg");

Advanced Usage

Running Multiple Requests in Parallel

const [img, chat_response] = await Promise.all([
  socaity.text2img("A cyberpunk landscape", "flux-schnell"),
  socaity.chat("Describe quantum physics in simple terms.")
]);

Working with files (media-toolkit)

The SocAIty SDK includes a powerful toolkit that simplifies handling files across both Node.js and browser environments. Check-out the media-toolkit docs to learn more about it.

Working directly with your favorite models.

Many models are directly importable by the module. Some of them have specialized methods and parameters which are not included to the simple usage wrapper methods like socaity.text2img.

import { FluxSchnell } from "socaity";
FluxSchnell.text2img("Rick and Morty swimming in a lake", { 
    num_outputs: 3,   
    aspect_ratio: "16:9",
    num_outputs: 3,
    num_inference_steps: 5}
).then(images => { ... });

Browser & Node.js Support

  • Node.js: Works with import { socaity } from "socaity".
  • Browser: Use the UMD build: <script src="socaity.umd.js"></script>.

You might be interested also in the python SDK

Contributing

We welcome contributions! Submit PRs or report issues in the GitHub Repos or in the Help section of your socaity account.

License

This SDK is open-source and available under the MIT License.

🌟 Star this repo if you find it useful!

Note: We are in alpha version. Thus expect rapid changes to the SDK, APIs and more models to be added frequently.