Invect

Quick Start

Get Invect running in 5 minutes with Express and React.

Installation

Install the core package and your framework adapter:

npm install @invect/core @invect/express

Backend Setup

Create a file and mount the Invect router:

server.ts
import express from 'express';
import { createInvectRouter } from '@invect/express';

const app = express();

app.use('/invect', createInvectRouter({
  baseDatabaseConfig: {
    type: 'sqlite',
    connectionString: 'file:./dev.db',
    id: 'main',
  },
}));

app.listen(3000, () => {
  console.log('Server running on http://localhost:3000');
});

That's it for the backend. The router handles all API endpoints — flows, executions, credentials, agent tools, and more.

app.module.ts
import { Module } from '@nestjs/common';
import { InvectModule } from '@invect/nestjs';

@Module({
  imports: [
    InvectModule.forRoot({
      baseDatabaseConfig: {
        type: 'sqlite',
        connectionString: process.env.DATABASE_URL || 'file:./dev.db',
        id: 'main',
      },
    }),
  ],
})
export class AppModule {}
app/api/invect/[...route]/route.ts
import { createInvectHandler } from '@invect/nextjs';

const handler = createInvectHandler({
  baseDatabaseConfig: {
    type: 'sqlite',
    connectionString: process.env.DATABASE_URL || 'file:./dev.db',
    id: 'main',
  },
});

export const GET = handler;
export const POST = handler;
export const PUT = handler;
export const DELETE = handler;

Frontend Setup

The React frontend is a single component. Install it in your frontend app:

App.tsx
import { Invect } from '@invect/frontend';
import '@invect/frontend/styles';

export default function App() {
  return (
    <Invect apiBaseUrl="http://localhost:3000/invect" />
  );
}

This gives you the complete flow editor, execution viewer, credential manager, and agent tool configuration — all in one component.

Environment Variables

For AI features, you'll need API keys. Store credentials through the Invect UI (Credentials page) or seed them via config:

.env
# Required for encrypted credential storage
INVECT_ENCRYPTION_KEY=<base64-encoded-32-byte-key>

Generate an encryption key:

npx invect-cli secret

Next Steps