{"_id":"@databridgeai/connector","_rev":"6-0a480ed9e35bbfe515a8dc9e83bb7740","name":"@databridgeai/connector","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@databridgeai/connector","version":"1.0.0","keywords":["databridgeai","ai","database","connector","natural-language","postgres","mongodb","node"],"license":"MIT","_id":"@databridgeai/connector@1.0.0","maintainers":[{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"}],"homepage":"https://github.com/rishabhAgg/DataBridgeAI#readme","bugs":{"url":"https://github.com/rishabhAgg/DataBridgeAI/issues"},"dist":{"shasum":"1146844da1a4101ab26e6a5ebe5e8180e0562a89","tarball":"https://registry.npmjs.org/@databridgeai/connector/-/connector-1.0.0.tgz","fileCount":10,"integrity":"sha512-KuKMrm8vXAMp8Pm6JCHZaB2+QFoSKu/+alHyNNl+P2Jp6zIxVopsUl+tddTQ7ts+jRMUBNJQFis6F5Fsy9LyyA==","signatures":[{"sig":"MEYCIQDCsCcQpcfQQjGcC7d4KzRUDKetVgft5mngkLEQWh5QFAIhALRGH28dSukkUeDbfEqoTRwFPgyRvgTRk9hRyNuE9Ojx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18644},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"24eb976b5556503fb73f9af1e781ce2f83bbe899","scripts":{"dev":"tsc -p tsconfig.json --watch","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"},"repository":{"url":"git+https://github.com/rishabhAgg/DataBridgeAI.git","type":"git","directory":"packages/connector"},"_npmVersion":"10.8.2","description":"DataBridge AI Connector — Connect your Node.js backend to DataBridge for natural language database queries","directories":{},"_nodeVersion":"20.20.0","dependencies":{"pg":"^8.11.3","mongodb":"^6.3.0","@databridgeai/core":"*","@databridgeai/toolkit":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/pg":"^8.10.9","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/connector_1.0.0_1771573237690_0.09150080114970649","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@databridgeai/connector","version":"1.1.0","keywords":["databridgeai","ai","database","connector","natural-language","postgres","mongodb","node"],"license":"MIT","_id":"@databridgeai/connector@1.1.0","maintainers":[{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"}],"homepage":"https://github.com/rishabhAgg/DataBridgeAI#readme","bugs":{"url":"https://github.com/rishabhAgg/DataBridgeAI/issues"},"dist":{"shasum":"a681dab7d658a4b1f2187aa28202e281043c5df5","tarball":"https://registry.npmjs.org/@databridgeai/connector/-/connector-1.1.0.tgz","fileCount":10,"integrity":"sha512-Pe5zAndJqr95mxrG9eeDv80U39/gkBF2jvwSMwV9zMu6CJZTBalEwjc4+zyqnKpELkUdF/TdW4ArwqtJY25kEg==","signatures":[{"sig":"MEUCIERyyRcViSZZwTwtSqskKfFZe+S8MVQ+tWmeRa/qN6DbAiEA5NDcDTAD/rr5p42HgzHiGxrSynTgxeVwS0+V7Z9KpOM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20693},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"e65b44ec685c6fdb90aa89380d6bba360cd7436a","scripts":{"dev":"tsc -p tsconfig.json --watch","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"},"repository":{"url":"git+https://github.com/rishabhAgg/DataBridgeAI.git","type":"git","directory":"packages/connector"},"_npmVersion":"10.8.2","description":"DataBridge AI Connector — Connect your Node.js backend to DataBridge for natural language database queries","directories":{},"_nodeVersion":"20.20.0","dependencies":{"pg":"^8.11.3","mongodb":"^6.3.0","couchbase":"^4.4.0","@databridgeai/core":"*","@databridgeai/toolkit":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/pg":"^8.10.9","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/connector_1.1.0_1771660873604_0.5920410984611788","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@databridgeai/connector","version":"1.1.1","keywords":["databridgeai","ai","database","connector","natural-language","postgres","mongodb","node"],"license":"MIT","_id":"@databridgeai/connector@1.1.1","maintainers":[{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"}],"homepage":"https://github.com/rishabhAgg/DataBridgeAI#readme","bugs":{"url":"https://github.com/rishabhAgg/DataBridgeAI/issues"},"dist":{"shasum":"d7d113e6789084b3f03e65eacb6d8d139d114822","tarball":"https://registry.npmjs.org/@databridgeai/connector/-/connector-1.1.1.tgz","fileCount":10,"integrity":"sha512-Y3YrXK2F2PNXuLM5ivFT7rVtNtXTjPJUe3Ur1ssgvJyGeB9fSxYvF1yD8WM6B9vAss02XhnSk66ggeECRI67Rg==","signatures":[{"sig":"MEUCIGfoqCVASlveV9v5VGKZszrJXrMkYKMzEhDjw080vggwAiEAlEg4Db+kX0zmAWw2tW1Eia6wXSS3elq3Ag04K/T9B0k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20752},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"3830d8d5669857f3aa92e31054d7f57c4e471f99","scripts":{"dev":"tsc -p tsconfig.json --watch","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"},"repository":{"url":"git+https://github.com/rishabhAgg/DataBridgeAI.git","type":"git","directory":"packages/connector"},"_npmVersion":"10.8.2","description":"DataBridge AI Connector — Connect your Node.js backend to DataBridge for natural language database queries","directories":{},"_nodeVersion":"20.20.0","dependencies":{"pg":"^8.11.3","mongodb":"^6.3.0","couchbase":">=4.2.0 <5.0.0","@databridgeai/core":"*","@databridgeai/toolkit":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/pg":"^8.10.9","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/connector_1.1.1_1771664828669_0.5486356604579619","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@databridgeai/connector","version":"1.1.2","keywords":["databridgeai","ai","database","connector","natural-language","postgres","mongodb","node"],"license":"MIT","_id":"@databridgeai/connector@1.1.2","maintainers":[{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"}],"homepage":"https://github.com/rishabhAgg/DataBridgeAI#readme","bugs":{"url":"https://github.com/rishabhAgg/DataBridgeAI/issues"},"dist":{"shasum":"6823fade40287516fbc14e5a0874c0accaf8eb26","tarball":"https://registry.npmjs.org/@databridgeai/connector/-/connector-1.1.2.tgz","fileCount":10,"integrity":"sha512-cCjJ5g+98UJRLzMelU4XI+FrwqwHNMHVp6PYlDsWELSWzaTXeevvtwXEJrkxhzXO9Jjvdrq4j2mxMbP7t4sBew==","signatures":[{"sig":"MEQCIAJilV4ZwF2y578g3ENKruJMJ8aSiPsMGfiJkytK5tXuAiBYmoFAIZVOipHxHhPWrx47AdbyglfcxgKZ3brbmLDR3Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21602},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"2e3f575bf12d5c4750d4a316baedc742dab55283","scripts":{"dev":"tsc -p tsconfig.json --watch","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"},"repository":{"url":"git+https://github.com/rishabhAgg/DataBridgeAI.git","type":"git","directory":"packages/connector"},"_npmVersion":"10.8.2","description":"DataBridge AI Connector — Connect your Node.js backend to DataBridge for natural language database queries","directories":{},"_nodeVersion":"20.20.0","dependencies":{"pg":"^8.11.3","mongodb":"^6.3.0","couchbase":">=4.2.0 <5.0.0","@databridgeai/core":"*","@databridgeai/toolkit":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/pg":"^8.10.9","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/connector_1.1.2_1771670906108_0.8531586660747721","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@databridgeai/connector","version":"1.1.3","keywords":["databridgeai","ai","database","connector","natural-language","postgres","mongodb","node"],"license":"MIT","_id":"@databridgeai/connector@1.1.3","maintainers":[{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"}],"homepage":"https://github.com/rishabhAgg/DataBridgeAI#readme","bugs":{"url":"https://github.com/rishabhAgg/DataBridgeAI/issues"},"dist":{"shasum":"9a4862fd03d262c57dd68d5da421c0f8b240a3ed","tarball":"https://registry.npmjs.org/@databridgeai/connector/-/connector-1.1.3.tgz","fileCount":10,"integrity":"sha512-T9JWO26QgXJvoBwx3NHgFOkPYc1xDW/3dt13SuXQnaKEte0qr1rxoJuZttRgDhUdDaNKvn8cUZj7D+e34mKOYQ==","signatures":[{"sig":"MEUCIQCTQ5KeibG+EQD3TLoLwK0SJiKHSzYBbYcah9Wah5qs7QIgdsuuM5Mtce2Ovo1z+7hCUd2JsS8L5AagjLmoiUYQrx4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22264},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"9867831db80953365ca6a69e0f9cc965b48ddc2d","scripts":{"dev":"tsc -p tsconfig.json --watch","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"},"repository":{"url":"git+https://github.com/rishabhAgg/DataBridgeAI.git","type":"git","directory":"packages/connector"},"_npmVersion":"10.8.2","description":"DataBridge AI Connector — Connect your Node.js backend to DataBridge for natural language database queries","directories":{},"_nodeVersion":"20.20.0","dependencies":{"pg":"^8.11.3","mongodb":"^6.3.0","couchbase":">=4.2.0 <5.0.0","@databridgeai/core":"*","@databridgeai/toolkit":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/pg":"^8.10.9","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/connector_1.1.3_1771690282094_0.1969075740839148","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@databridgeai/connector","version":"2.0.0","description":"DataBridge AI Connector — Connect your Node.js backend to DataBridge for natural language database queries","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","dev":"tsc -p tsconfig.json --watch"},"dependencies":{},"devDependencies":{"typescript":"^5.3.3"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/rishabhAgg/DataBridgeAI.git","directory":"packages/connector"},"homepage":"https://github.com/rishabhAgg/DataBridgeAI#readme","keywords":["databridgeai","ai","database","connector","natural-language","node"],"license":"MIT","_id":"@databridgeai/connector@2.0.0","gitHead":"cad9d7ddf391a148eb80723c156da196ca4712b6","bugs":{"url":"https://github.com/rishabhAgg/DataBridgeAI/issues"},"_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-x/vPmX/z40GfBwSjbLpnQbTSXd13QHHQap7Mwj9umubaJQIHBx0qupD9+P8lFeEYHsp9XAambf6dfke3MpaBSg==","shasum":"7e78b25c81d437f5f8a54a062961298f8a11c3d5","tarball":"https://registry.npmjs.org/@databridgeai/connector/-/connector-2.0.0.tgz","fileCount":10,"unpackedSize":17287,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICVOsFpn3JWLN3BC4aCJaGPNauU3g5e9NTxzJRWuKUG8AiEAjVofirZCTpa/l6epY0kwcriS+OhTW5yf2SQX4XE/+a4="}]},"_npmUser":{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"},"directories":{},"maintainers":[{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/connector_2.0.0_1771763912258_0.41060012222284703"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-20T07:40:37.622Z","modified":"2026-02-22T12:38:32.570Z","1.0.0":"2026-02-20T07:40:37.868Z","1.1.0":"2026-02-21T08:01:13.751Z","1.1.1":"2026-02-21T09:07:08.825Z","1.1.2":"2026-02-21T10:48:26.275Z","1.1.3":"2026-02-21T16:11:22.239Z","2.0.0":"2026-02-22T12:38:32.435Z"},"bugs":{"url":"https://github.com/rishabhAgg/DataBridgeAI/issues"},"license":"MIT","homepage":"https://github.com/rishabhAgg/DataBridgeAI#readme","keywords":["databridgeai","ai","database","connector","natural-language","node"],"repository":{"type":"git","url":"git+https://github.com/rishabhAgg/DataBridgeAI.git","directory":"packages/connector"},"description":"DataBridge AI Connector — Connect your Node.js backend to DataBridge for natural language database queries","maintainers":[{"name":"rishabh105","email":"aggarwalrishabh105@gmail.com"}],"readme":"# @databridgeai/connector\n\n**Connect your Node.js backend to DataBridge AI for natural language database queries.**\n\nYour 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.\n\n## Quick Start\n\n```bash\nnpm install @databridgeai/connector\n```\n\n```typescript\nimport { initExecutorAgent } from '@databridgeai/connector';\nimport { Pool } from 'pg';\n\nconst pool = new Pool({ connectionString: process.env.DATABASE_URL });\n\nconst agent = await initExecutorAgent({\n  apiKey: process.env.DATABRIDGE_API_KEY!,\n  runtimeUrl: 'https://your-databridge-server.vercel.app',\n  db: pool,\n  exposeTables: ['users', 'orders', 'products'],\n  tenantField: 'organization_id',\n});\n\n// Start the agent (introspects schema, registers with server)\nawait agent.init();\n```\n\n## Express Middleware\n\nDrop a chat endpoint into any Express app:\n\n```typescript\nimport express from 'express';\n\nconst app = express();\napp.use(express.json());\n\n// One line to add AI-powered database chat\napp.post('/api/ai/chat', agent.middleware());\n\napp.listen(4000);\n```\n\n## Direct Query API\n\n```typescript\nconst result = await agent.query(\n  'Show me all premium customers who joined this year',\n  { userId: 'user_123', orgId: 'acme_corp', role: 'admin' }\n);\n\nconsole.log(result.message);       // \"Here are 42 premium customers...\"\nconsole.log(result.data.rows);     // Actual database rows\nconsole.log(result.visualization); // Optional chart config\n```\n\n## How It Works\n\n```\nYour React App → Your Node Backend → DataBridge Server → OpenAI\n                      ↓                    ↓\n               Executes query        Generates safe\n               on YOUR database      QueryDSL + NL response\n```\n\n1. **Your backend** sends the user's question to DataBridge Server\n2. **DataBridge Server** uses GPT-4o to generate a safe, validated QueryDSL\n3. **Your backend** executes the query on your own database (data stays local)\n4. **DataBridge Server** composes a natural language response from the results\n\n## Features\n\n- **Multi-tenant isolation**: Automatic `WHERE organization_id = ?` filtering\n- **Schema-aware**: Auto-introspects your Postgres/MongoDB schema\n- **Safe queries**: All queries validated against schema, no raw SQL injection\n- **Local execution**: Your database credentials never leave your backend\n- **Chart visualizations**: Automatic chart suggestions for aggregate data\n- **Image detection**: Renders image URLs inline in results\n\n## Configuration\n\n```typescript\nconst agent = await initExecutorAgent({\n  // Required\n  apiKey: string;          // Your DataBridge API key\n  db: Pool | Db;           // Postgres Pool or MongoDB Db instance\n  exposeTables: string[];  // Tables to expose to AI\n\n  // Optional\n  runtimeUrl?: string;     // DataBridge server URL (default: http://localhost:3100)\n  tenantField?: string;    // Column used for tenant isolation (e.g., 'org_id')\n});\n```\n\n## Supported Databases\n\n| Database | Driver | Minimum Version |\n|----------|--------|----------------|\n| PostgreSQL | `pg` | 8.x+ |\n| MongoDB | `mongodb` | 6.x+ |\n\n## Security\n\n- Database credentials **never leave your backend**\n- All queries validated against your schema before execution\n- Tenant field ensures row-level isolation per organization\n- API key authentication for all server communication\n\n## Related Packages\n\n| Package | Purpose |\n|---------|---------|\n| `@databridgeai/react` | Drop-in React chat widget |\n| `@databridgeai/toolkit` | Schema introspection & utilities |\n| `@databridgeai/core` | Shared types & validators |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}