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

@ainative/zerodb-functions

v1.0.0

Published

ZeroDB Functions — serverless functions triggered by database events. Supabase Edge Functions compatible API.

Readme

@zerodb/functions-js

Serverless functions triggered by ZeroDB database events. Drop-in replacement for @supabase/functions-js.

Zero dependencies. Works with Node.js 18+, Deno, Bun, and Cloudflare Workers.

Install

npm install @zerodb/functions-js

Quick Start

import { ZeroDBFunctions } from '@zerodb/functions-js';

const functions = new ZeroDBFunctions({
  apiKey: process.env.ZERODB_API_KEY,
});

// Create a function triggered by database events
const { data, error } = await functions.create('auto-embed', {
  trigger: 'zerodb.vector.stored',
  hookConfig: { model: 'bge-m3' },
});

// Invoke a function
const { data: result } = await functions.invoke('auto-embed', {
  body: { text: 'Hello, World!' },
});

// List all functions
const { data: fns } = await functions.list();

// Update a function
await functions.update('auto-embed', {
  hookConfig: { model: 'text-embedding-3-small' },
});

// Delete a function
await functions.delete('auto-embed');

API

new ZeroDBFunctions(options)

| Option | Type | Required | Default | |--------|------|----------|---------| | apiKey | string | Yes | — | | baseUrl | string | No | https://api.ainative.studio | | projectId | string | No | — | | headers | object | No | {} | | fetch | function | No | globalThis.fetch |

Methods

All methods return Promise<{ data, error }>.

functions.create(name, config)

Register a function triggered by a ZeroDB event.

await functions.create('on-vector-store', {
  trigger: 'zerodb.vector.stored',   // required
  hookConfig: { /* handler config */ },
  projectId: 'proj-123',             // optional, scopes to project
});

functions.invoke(name, options?)

Invoke a function by name.

const { data, error } = await functions.invoke('my-function', {
  body: { key: 'value' },
  headers: { 'X-Custom': 'yes' },
});

functions.list(options?)

List registered functions.

const { data } = await functions.list({
  eventType: 'zerodb.vector.stored',  // filter by event
  activeOnly: true,                    // default: true
});

functions.get(id)

Get a single function by UUID.

functions.update(nameOrId, config)

Update a function by name or UUID.

await functions.update('my-function', {
  hookConfig: { url: 'https://new-webhook.example.com' },
  isActive: false,
});

functions.delete(nameOrId)

Delete a function by name or UUID.

Event Types

| Event | Description | |-------|-------------| | zerodb.vector.stored | A vector embedding was stored | | zerodb.vector.deleted | A vector was deleted | | zerodb.memory.stored | A memory was stored via ZeroMemory | | zerodb.memory.recalled | A memory was recalled | | zerodb.table.row_inserted | A row was inserted into a NoSQL table | | zerodb.table.row_updated | A row was updated | | zerodb.table.row_deleted | A row was deleted | | zerodb.file.uploaded | A file was uploaded to storage |

Error Handling

import { FunctionsHttpError, FunctionsFetchError } from '@zerodb/functions-js';

const { data, error } = await functions.invoke('my-fn');

if (error instanceof FunctionsHttpError) {
  console.log('HTTP error:', error.status, error.message);
} else if (error instanceof FunctionsFetchError) {
  console.log('Network error:', error.message);
}

Migrating from Supabase Edge Functions

| Supabase | ZeroDB | |----------|--------| | supabase.functions.invoke('hello') | functions.invoke('hello') | | Deploy via CLI (supabase functions deploy) | functions.create('hello', { trigger: '...' }) | | Manual function files | Event-driven hooks, auto-provisioned | | Deno.serve(...) handler | Hook config points to handler |

Key difference: ZeroDB functions are event-driven by default. Instead of deploying code files, you register hooks that trigger on database events. The handler runs in ZeroDB's sandboxed executor.

// Supabase
const { data, error } = await supabase.functions.invoke('hello', {
  body: { name: 'World' },
});

// ZeroDB — same API shape
const { data, error } = await functions.invoke('hello', {
  body: { name: 'World' },
});

CommonJS

const { ZeroDBFunctions } = require('@zerodb/functions-js');

Get an API Key

  1. Sign up at zerodb.dev
  2. Create a project
  3. Copy your API key from the dashboard

Or use the CLI:

npx zerodb-cli init

License

MIT