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

synexa

v1.0.4

Published

Official Node.js client for Synexa AI API

Readme

Synexa Node.js Client

A Node.js client for Synexa AI API. It lets you run AI models and manage predictions through Synexa's HTTP API.

Installation

Install it from npm:

npm install synexa

Usage

Import the package:

// ESM
import Synexa from 'synexa';

// CommonJS
const Synexa = require('synexa').default;

Instantiate the client:

const synexa = new Synexa({
  auth: process.env.SYNEXA_API_TOKEN // Your Synexa API token
});

Run a model and await the result:

const model = "black-forest-labs/flux-schnell";
const input = {
  prompt: "An astronaut riding a rainbow unicorn, cinematic, dramatic"
};

const [output] = await synexa.run(model, { input });
// If the output is a URL, you get a FileOutput object
if (output instanceof FileOutput) {
  console.log(output.url()); // Get the URL string
  const blob = await output.blob(); // Get the file data as a Blob
}

You can also create a prediction with more control:

// Create a prediction with webhook
const prediction = await synexa.createPrediction({
  model: "black-forest-labs/flux-schnell",
  input: {
    prompt: "An astronaut riding a rainbow unicorn, cinematic, dramatic"
  },
  webhook: "https://your-webhook-url.com",
  webhook_events_filter: ["start", "completed"]
});

// Get prediction status
const status = await synexa.getPrediction(prediction.id);

// Wait for the prediction with options
const result = await synexa.wait(prediction, {
  type: "block", // "block" or "poll"
  interval: 1000, // polling interval in ms
  timeout: 60 // timeout in seconds for blocking mode
});

console.log(result.output);

Advanced usage with all options:

const controller = new AbortController();

const [output] = await synexa.run("black-forest-labs/flux-schnell", {
  input: {
    prompt: "An astronaut riding a rainbow unicorn, cinematic, dramatic"
  },
  wait: {
    type: "block", // or "poll"
    interval: 1000, // polling interval in ms
    timeout: 60 // timeout in seconds for blocking mode
  },
  webhook: "https://your-webhook-url.com",
  webhook_events_filter: ["start", "output", "logs", "completed"],
  signal: controller.signal, // AbortSignal for cancellation
  progress: (prediction) => {
    console.log(`Status: ${prediction.status}`);
  }
});

API Reference

Constructor Options

| Option | Type | Description | |--------|------|-------------| | auth | string | Required. Your Synexa API token | | baseUrl | string | Optional. The base URL for the Synexa API |

Run Options

| Option | Type | Description | |--------|------|-------------| | input | object | Required. An object with the model inputs | | wait.type | "poll" | "block" | "block" holds the request open, "poll" makes repeated requests. Defaults to "block" | | wait.interval | number | Polling interval in milliseconds. Defaults to 500 | | wait.timeout | number | In "block" mode determines how long the request will be held open until falling back to polling. Defaults to 60 | | webhook | string | An HTTPS URL for receiving a webhook when the prediction has new output | | webhook_events_filter | string[] | An array of events which should trigger webhooks. Values: "start", "output", "logs", "completed" | | signal | AbortSignal | An AbortSignal to cancel the prediction | | progress | function | Callback function that receives the prediction object as it's updated |

FileOutput

The FileOutput class implements ReadableStream and provides methods to access file data:

  • url(): Get the URL string for the file
  • blob(): Get the file data as a Blob

Error Handling

The client will throw errors for various failure cases:

  • Network errors
  • API errors
  • Timeout errors when polling for results
  • Missing or invalid output
  • Prediction cancellation
  • Failed predictions with error messages