Self-Host SchemaFX
Run SchemaFX on your own infrastructure.
What you’ll deploy
Required configuration
Prerequisites
Minimal Setup
Last updated
Run SchemaFX on your own infrastructure.
Last updated
mkdir schemafx-server
cd schemafx-server
npm init -y
npm install schemafx
npm install -D tsximport SchemaFX, { FileConnector } from 'schemafx';
const file = new FileConnector({
id: 'file',
filePath: process.env.SCHEMAFX_DATA_DIR ?? './data'
});
const sfx = new SchemaFX({
jwtOpts: {
secret: process.env.JWT_SECRET!
},
dataServiceOpts: {
schemaConnector: { connector: file.id },
connectionsConnector: { connector: file.id },
permissionsConnector: { connector: file.id },
connectors: [
file
]
}
});
await sfx.listen({
port: Number(process.env.PORT ?? 3000),
host: process.env.HOST ?? '0.0.0.0'
});export JWT_SECRET='replace-me'
export SCHEMAFX_DATA_DIR='./data'
export PORT=3000
# TypeScript (no build step)
npx tsx index.ts
# JavaScript
node index.js