
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
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.
Install via npm:
npm install socaity
import { socaity } from "socaity";
socaity.setApiKey('sk...'); // we recommend settting the API key with environment variables.
Register and get your API key
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.
const images = await socaity.text2img("A futuristic city at sunset", "flux-schnell", { num_outputs: 1 });
await images[0].save("output/futuristic_city.jpg");
const audio = await socaity.text2voice("Hello, welcome to Socaity!");
await audio.save("output/welcome_message.mp3");
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");
const result = await socaity.swapImg2Img("data/source.jpg", "data/target.jpg");
await result.save("output/face_swap.jpg");
const [img, chat_response] = await Promise.all([
socaity.text2img("A cyberpunk landscape", "flux-schnell"),
socaity.chat("Describe quantum physics in simple terms.")
]);
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.
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 => { ... });
import { socaity } from "socaity"
.<script src="socaity.umd.js"></script>
.You might be interested also in the python SDK
We welcome contributions! Submit PRs or report issues in the GitHub Repos or in the Help section of your socaity account.
This SDK is open-source and available under the MIT License.
Note: We are in alpha version. Thus expect rapid changes to the SDK, APIs and more models to be added frequently.
FAQs
SDK for Generative AI. Build AI-powered applications with ease
The npm package socaity receives a total of 4 weekly downloads. As such, socaity popularity was classified as not popular.
We found that socaity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.