Install and configure the SDK

Install the Cliodot SDK, configure credentials, and run the supplied quickstart.

PrerequisitesWhat is Cliodot?

Technical review: The approved sources use multiple package names across examples. This page preserves the cliodot package named by the SDK reference; confirm the package used by your project before installation.

npm install cliodot

ES Modules / TypeScript

import { flosync, v } from 'cliodot';

CommonJS

const { flosync, v } = require('cliodot');

Optional peer dependencies (install only what you use):

npm install mongodb mysql2 pg ioredis argon2 bcrypt

Quick start#

import { flosync, v } from 'cliodot';

flosync.configure({
 connectors: {
   'mongodb.system': { uri: process.env.MONGO_URI, database: 'myapp' },
 },
});

const w = flosync.workflow('create-order')
 .http('POST', '/orders')
 .step('save', s => s.db('mongodb', 'insertOne', { collection: 'orders', document: v.body() }))
 .step('respond', s => s.responder('json', { body: v.stepResult('save') }))
 .build();

flosync.register(w);

const result = await flosync.run('create-order', { body: { item: 'Widget', qty: 2 } });

Configuration#

flosync.configure({
 apiKey: process.env.FLOSYNC_API_KEY,
 apiSecret: process.env.FLOSYNC_API_SECRET,
 baseUrl: process.env.CLIODOT_BASE_URL,
 projectId: process.env.FLOSYNC_PROJECT_ID,
 connectors: {
   'mongodb.system': { uri: process.env.MONGO_URI, database: 'myapp' },
 },
});

For remote runs against your Cliodot account, set apiKey and apiSecret. baseUrl defaults to http://localhost:8080 when omitted.