@invect/version-control
v0.0.12
Published
Version control plugin for Invect — sync flows to GitHub/GitLab/Bitbucket as .flow.ts files
Downloads
1,410
Readme
Sync Invect flows to GitHub (and other Git providers) as readable .flow.ts TypeScript files. Supports push, pull, PR-based publishing, and bidirectional sync.
Install
pnpm add @invect/version-controlBackend
import { versionControl } from '@invect/version-control';
import { githubProvider } from '@invect/version-control/providers/github';
const invectRouter = await createInvectRouter({
database: { type: 'sqlite', connectionString: 'file:./dev.db' },
encryptionKey: process.env.INVECT_ENCRYPTION_KEY,
plugins: [
versionControl({
provider: githubProvider({ auth: process.env.GITHUB_TOKEN! }),
repo: 'org/my-flows',
}),
],
});
app.use('/invect', invectRouter);Options
versionControl({
provider: githubProvider({ auth: '...' }), // Git hosting provider
repo: 'owner/repo', // Default repository (owner/name)
defaultBranch: 'main', // Target branch
path: 'flows/', // Directory in the repo for flow files
mode: 'pr-per-publish', // "direct-commit" | "pr-per-save" | "pr-per-publish"
syncDirection: 'push', // "push" | "pull" | "bidirectional"
webhookSecret: '...', // Webhook secret for PR merge events
});Features
- Push/pull — Sync flows to and from a Git repository.
- PR-based publishing — Create pull requests for flow changes, merge to deploy.
- Bidirectional sync — Keep flows in sync between Invect and Git.
- Readable exports — Flows are serialized as
.flow.tsTypeScript files. - Sync history — Full audit trail of sync operations with commit SHAs.
Exports
| Entry Point | Content |
| ------------------------------------------ | ------------------------ |
| @invect/version-control | Backend plugin (Node.js) |
| @invect/version-control/providers/github | GitHub provider |
| @invect/version-control/types | Shared types |
