@invect/express
v0.0.12
Published
Express.js integration package for Invect Core
Maintainers
Readme
Mount Invect into any Express app with a single router. All API endpoints — flows, executions, credentials, agent tools, OAuth2 — are handled automatically.
Install
npx invect-cli initOr install manually:
npm install @invect/core @invect/expressUsage
import express from 'express';
import { createInvectRouter } from '@invect/express';
const app = express();
const invectRouter = await createInvectRouter({
database: {
type: 'sqlite',
connectionString: 'file:./dev.db',
},
encryptionKey: process.env.INVECT_ENCRYPTION_KEY, // npx invect-cli secret
});
app.use('/invect', invectRouter);
app.listen(3000);That's it. The router handles initialization, batch polling, and all API routes.
With Plugins
import { auth } from '@invect/user-auth';
import { rbac } from '@invect/rbac';
const invectRouter = await createInvectRouter({
database: { type: 'sqlite', connectionString: 'file:./dev.db' },
encryptionKey: process.env.INVECT_ENCRYPTION_KEY,
plugins: [auth({ globalAdmins: [{ email: '[email protected]', pw: 'secret' }] }), rbac()],
});
app.use('/invect', invectRouter);Frontend
Pair with @invect/ui for the visual flow editor:
import { Invect } from '@invect/ui';
import '@invect/ui/styles';
<Invect apiBaseUrl="http://localhost:3000/invect" />;