Deployment
Standalone Deployment
Run UDL as a separate server
Prerequisites
- Node.js 20 or higher
Simplest Scenario
Create a udl.config.ts file:
udl.config.ts
import { defineConfig } from 'universal-data-layer';
export const config = defineConfig({
port: 4000,
});
Run UDL:
npx universal-data-layer
If your server exposes port 4000, UDL is now accessible at http://your-server:4000/graphql.
To bind to a different port, update your config or use your web server's port forwarding.
With Plugins
Initialize a project:
npm init -y
Install your plugins:
npm install universal-data-layer @universal-data-layer/plugin-source-contentful
Create udl.config.ts with plugin options:
udl.config.ts
import { defineConfig } from 'universal-data-layer';
export const config = defineConfig({
port: 4000,
plugins: [
{
name: '@universal-data-layer/plugin-source-contentful',
options: {
spaceId: process.env.CONTENTFUL_SPACE_ID,
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
},
},
],
});
Run UDL:
npx universal-data-layer
Next Steps
- Remote Sync - Sync data from a production UDL server
- Production Deployment - Run alongside your app
- Webhook Setup - Configure CMS webhooks