@flowlib/express
v0.0.5
Published
Express.js integration package for Flowlib Core
Downloads
468
Maintainers
Readme
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 initOr install manually:
npm install @flowlib/core @flowlib/expressUsage
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: '[email protected]', 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" />;