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.
.\web
contains Gatsby5 app wired up to Uniform SDK..\uniform-source-plugin
contains Gatsby plugin for Uniform.
-
git clone
-
cd .\uniform-source-plugin
and runnpm install
-
cd .\web
and runnpm install
-
Create
.env
under.\web
folder (see.env.example
) and fill out two env vars based on your Uniform project:UNIFORM_API_KEY= UNIFORM_PROJECT_ID=
-
Run
npm run uniform:push
to push contents from disk (/content
folder) 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:publish
to publish all compositions (optional if you intend to be working in dev mode). -
Run
npm run dev
to start dev server. -
Configure preview in Canvas settings to use
http://localhost:8000/api/preview
while working locally
- Run
npm run build
to perform production build - Run
npm run serve
to startup the site (localhost:9000) will be used now. - Configure preview in Canvas settings to use
http://localhost:9000/api/preview
if you want preview to use production mode.
Check out our integrations docs to see how to add content from your existing systems.