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

@edenlabs/eden-sdk

v0.4.6

Published

SDK for interacting with the Eden API

Readme

Eden SDK

The official SDK for interacting with the Eden API. Supports both Node.js and browser environments.

Installation

npm install @edenlabs/eden-sdk
# or
yarn add @edenlabs/eden-sdk

Environment-Specific Configuration

Node.js Environment

When using the SDK in a Node.js environment, no additional configuration is required. The SDK will automatically use the appropriate EventSource implementation.

Browser Environment (Webpack 5+)

If you're using Webpack 5 or later in a browser environment, you'll need to add the following configuration to your webpack.config.js:

module.exports = {
  // ... other config
  resolve: {
    fallback: {
      "url": false,
      "http": false,
      "https": false,
      "util": false
    }
  }
}

Browser Environment (Using pre-built bundle)

For browser applications, you can use our pre-built UMD bundle which includes all necessary polyfills:

<script src="https://unpkg.com/@edenlabs/[email protected]/dist/index.umd.js"></script>

The UMD bundle is specifically built to work in browsers without any additional configuration. If you're experiencing issues with the ES module version in a browser environment, we recommend using this UMD bundle instead.

Or import it in your module bundler:

import { EdenClient } from '@edenlabs/eden-sdk';

Basic Usage

import { EdenClient } from '@edenlabs/eden-sdk';

const client = new EdenClient({
  apiKey: 'your-api-key',
});

// Example: Create a task
const result = await client.tasks.createV2({
  tool: 'flux_dev',
  args: {
    prompt: 'Garden of Eden'
  }
});

Environment Detection

The SDK automatically detects whether it's running in Node.js or a browser environment and uses the appropriate EventSource implementation. No manual configuration is required for this feature.

Troubleshooting

Webpack 5 Polyfill Issues

If you encounter errors related to missing Node.js core modules (url, http, https, util), make sure you've added the fallback configuration as shown in the "Browser Environment (Webpack 5+)" section above.

SSE (Server-Sent Events) Connection Issues

  • For Node.js: Make sure you have network access to the Eden API endpoint
  • For Browsers: Ensure CORS is properly configured if you're running in a different domain

License

MIT

A thin wrapper around the Eden REST API. Inspect methods.ts for all available methods.

Creating an Eden instance

import { EdenClient } from "@edenlabs/eden-sdk";

const apiKey = 'YOUR_API_KEY';

const eden = new EdenClient({ apiKey });

Making a creation

Submit a task and await creation result

const input = {
  tool: "flux_dev",
  args: {
    prompt: "Garden of Eden"
  }
}

const result = await eden.createV2(input);

Submit a task and return task data immediately, without waiting for creation result

const input = {
  tool: "flux_dev",
  args: {
    prompt: "Garden of Eden"
  }
}

const result = await eden.createV2(input, false);

Creations

Get a single creation by id

const creation = await eden.creations.getV2({creationId: '1234567890'})

Tasks

Get a single task by id

const task = await eden.tasks.getV2({taskId: '1234567890'})

Get paginated list of tasks

const tasks = await eden.tasks.listV2();

Get paginated list of tasks filterd by tool and status

const tasks = await eden.tasks.listV2({ tool: 'flux_dev', status: 'pending' });

Tools

To get a list of all the tools available:

const tools = await eden.tools.list();

Get a single tool by key

const tool = await eden.tools.get({key: 'flux_dev'});

Uploading an image

import fs from 'fs'

const filepath = `${__dirname}/test.png`
const media = await fs.readFileSync(filepath)

const result = await eden.media.upload({ media })

Examples

See examples/ for more (*V2.js)