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

@databridgeai/connector

v2.0.0

Published

DataBridge AI Connector — Connect your Node.js backend to DataBridge for natural language database queries

Readme

@databridgeai/connector

Connect your Node.js backend to DataBridge AI for natural language database queries.

Your users ask questions in plain English. DataBridge AI translates them into safe, tenant-isolated database queries — and your backend executes them locally. Your data never leaves your infrastructure.

Quick Start

npm install @databridgeai/connector
import { initExecutorAgent } from '@databridgeai/connector';
import { Pool } from 'pg';

const pool = new Pool({ connectionString: process.env.DATABASE_URL });

const agent = await initExecutorAgent({
  apiKey: process.env.DATABRIDGE_API_KEY!,
  runtimeUrl: 'https://your-databridge-server.vercel.app',
  db: pool,
  exposeTables: ['users', 'orders', 'products'],
  tenantField: 'organization_id',
});

// Start the agent (introspects schema, registers with server)
await agent.init();

Express Middleware

Drop a chat endpoint into any Express app:

import express from 'express';

const app = express();
app.use(express.json());

// One line to add AI-powered database chat
app.post('/api/ai/chat', agent.middleware());

app.listen(4000);

Direct Query API

const result = await agent.query(
  'Show me all premium customers who joined this year',
  { userId: 'user_123', orgId: 'acme_corp', role: 'admin' }
);

console.log(result.message);       // "Here are 42 premium customers..."
console.log(result.data.rows);     // Actual database rows
console.log(result.visualization); // Optional chart config

How It Works

Your React App → Your Node Backend → DataBridge Server → OpenAI
                      ↓                    ↓
               Executes query        Generates safe
               on YOUR database      QueryDSL + NL response
  1. Your backend sends the user's question to DataBridge Server
  2. DataBridge Server uses GPT-4o to generate a safe, validated QueryDSL
  3. Your backend executes the query on your own database (data stays local)
  4. DataBridge Server composes a natural language response from the results

Features

  • Multi-tenant isolation: Automatic WHERE organization_id = ? filtering
  • Schema-aware: Auto-introspects your Postgres/MongoDB schema
  • Safe queries: All queries validated against schema, no raw SQL injection
  • Local execution: Your database credentials never leave your backend
  • Chart visualizations: Automatic chart suggestions for aggregate data
  • Image detection: Renders image URLs inline in results

Configuration

const agent = await initExecutorAgent({
  // Required
  apiKey: string;          // Your DataBridge API key
  db: Pool | Db;           // Postgres Pool or MongoDB Db instance
  exposeTables: string[];  // Tables to expose to AI

  // Optional
  runtimeUrl?: string;     // DataBridge server URL (default: http://localhost:3100)
  tenantField?: string;    // Column used for tenant isolation (e.g., 'org_id')
});

Supported Databases

| Database | Driver | Minimum Version | |----------|--------|----------------| | PostgreSQL | pg | 8.x+ | | MongoDB | mongodb | 6.x+ |

Security

  • Database credentials never leave your backend
  • All queries validated against your schema before execution
  • Tenant field ensures row-level isolation per organization
  • API key authentication for all server communication

Related Packages

| Package | Purpose | |---------|---------| | @databridgeai/react | Drop-in React chat widget | | @databridgeai/toolkit | Schema introspection & utilities | | @databridgeai/core | Shared types & validators |

License

MIT