This starter showcases the latest Uniform capabilities with Gatsby and is enabled for personalization and A/B testing.
- Uniform account. Request access here if you don't have one already.
- Node.js LTS installed.
.\webcontains Gatsby5 app wired up to Uniform SDK..\uniform-source-plugincontains Gatsby plugin for Uniform.
-
git clone -
cd .\uniform-source-pluginand runnpm install -
cd .\weband runnpm install -
Create
.envunder.\webfolder (see.env.example) and fill out two env vars based on your Uniform project:UNIFORM_API_KEY= UNIFORM_PROJECT_ID=
-
Run
npm run uniform:pushto push contents from disk (/contentfolder) into your project (this will overwrite your project contents, so be careful).The UNIFORM_API_KEY must have the Developer role assigned to be able to push content into the project.
-
Run
npm run uniform:publishto publish all compositions (optional if you intend to be working in dev mode). -
Run
npm run devto start dev server. -
Configure preview in Canvas settings to use
http://localhost:8000/api/previewwhile working locally
- Run
npm run buildto perform production build - Run
npm run serveto startup the site (localhost:9000) will be used now. - Configure preview in Canvas settings to use
http://localhost:9000/api/previewif you want preview to use production mode.
Check out our integrations docs to see how to add content from your existing systems.