Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Flowlib

@flowlib/express

Express adapter for Flowlib.
Docs · Quick Start


Mount Flowlib into any Express app with a single router. All API endpoints — flows, executions, credentials, agent tools, OAuth2 — are handled automatically.

Install

npx flowlib-cli init

Or install manually:

npm install @flowlib/core @flowlib/express

Usage

import express from 'express';
import { createFlowlibRouter } from '@flowlib/express';

const app = express();

const flowlibRouter = await createFlowlibRouter({
  database: {
    type: 'sqlite',
    connectionString: 'file:./dev.db',
  },
  encryptionKey: process.env.FLOWLIB_ENCRYPTION_KEY, // npx flowlib-cli secret
});

app.use('/flowlib', flowlibRouter);
app.listen(3000);

That's it. The router handles initialization, batch polling, and all API routes.

With Plugins

import { auth } from '@flowlib/user-auth';
import { rbac } from '@flowlib/rbac';

const flowlibRouter = await createFlowlibRouter({
  database: { type: 'sqlite', connectionString: 'file:./dev.db' },
  encryptionKey: process.env.FLOWLIB_ENCRYPTION_KEY,
  plugins: [auth({ globalAdmins: [{ email: 'admin@example.com', pw: 'secret' }] }), rbac()],
});

app.use('/flowlib', flowlibRouter);

Frontend

Pair with @flowlib/ui for the visual flow editor:

import { Flowlib } from '@flowlib/ui';
import '@flowlib/ui/styles';

<Flowlib apiBaseUrl="http://localhost:3000/flowlib" />;

License

MIT