Skip to content

Latest commit

 

History

History

gatsby5

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Gatsby starter for Uniform

This starter showcases the latest Uniform capabilities with Gatsby and is enabled for personalization and A/B testing.

Prerequisites

  1. Uniform account. Request access here if you don't have one already.
  2. Node.js LTS installed.

Repo structure

  1. .\web contains Gatsby5 app wired up to Uniform SDK.
  2. .\uniform-source-plugin contains Gatsby plugin for Uniform.

Getting started

  1. git clone

  2. cd .\uniform-source-plugin and run npm install

  3. cd .\web and run npm install

  4. 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=
  5. 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.

  6. Run npm run uniform:publish to publish all compositions (optional if you intend to be working in dev mode).

  7. Run npm run dev to start dev server.

  8. Configure preview in Canvas settings to use http://localhost:8000/api/preview while working locally

Run production mode

  1. Run npm run build to perform production build
  2. Run npm run serve to startup the site (localhost:9000) will be used now.
  3. Configure preview in Canvas settings to use http://localhost:9000/api/preview if you want preview to use production mode.

Adding new content sources

Check out our integrations docs to see how to add content from your existing systems.