Introduction
Getting Started
Get up and running with Universal Data Layer in minutes
Quick Start
The Universal Data Layer currently provides a GraphQL server with a simple API. Here's how to get started:
Terminal
npx universal-data-layer
Installation (locally, or globally with -g)
npm install universal-data-layer
pnpm add universal-data-layer
yarn add universal-data-layer
bun add universal-data-layer
Starting the Server
Once installed, you can start the GraphQL server:
npx universal-data-layer
# if installed globally
universal-data-layer
# if installed locally and added to scripts as "udl"
npm run udl
# if installed globally
universal-data-layer
# if installed locally and added to scripts as "udl"
yarn udl
# if installed globally
universal-data-layer
# if installed locally and added to scripts as "udl"
bun udl
Available Endpoints
Once the server is running, you'll have access to:
- GraphQL API:
http://localhost:4000/graphql - GraphiQL Interface:
http://localhost:4000/graphiql(for exploring the API)
Making Your First Query
The current schema provides a simple version query:
query.graphql
query {
version
}
You can test it using curl:
Terminal
curl http://localhost:4000/graphql \
-H "Content-Type: application/json" \
-d '{"query":"{ version }"}'
Or visit the GraphiQL interface at http://localhost:4000/graphiql to explore interactively.
Using Plugins
UDL supports a plugin-based architecture for extending functionality. To use plugins, create a udl.config.js file:
udl.config.js
export const config = {
port: 4000,
plugins: [
'@universal-data-layer/contentful',
{
name: '@universal-data-layer/shopify',
options: {
apiKey: process.env.SHOPIFY_API_KEY,
},
},
],
};
Learn more in the Plugin System documentation.
What's Next?
- Plugin System - Learn about the plugin architecture
- Creating Plugins - Build your own plugins
- API Documentation - Explore the API
This is an early-stage project in active development. Check the project repository for updates.