Setting Up your Nuxt.js Development Enviornment

Once logged into Agility CMS, you'll want to grab your API credentials so your Nuxt site can authenticate and retrieve data from your instance.

From your Agility CMS dashboard, click into Settings > API Keys.

Screen_Shot_2020-11-02_at_2.21.59_PM.png

Take note of your GUID and your Live API Key and Preview API Key credentials and copy these somewhere temporarily as you'll need to use them later.

Get The Code

Clone the starter repo from GitHub that has all the code you need to get started. Open up the code directory in your favorite Text Editor.

git clone git@github.com:agility/agilitycms-nuxtjs-starter.git

Run npm install or yarn install to install packages and dependencies

Set up Authentication

  1. Rename your .env.example file to .env 
  2. Overwrite the values in the .env file using your GUID, FETCH & PREVIEW API KEYS.
# Your Instance Id
AGILITY_GUID=

# Your Live API Key AGILITY_API_FETCH_KEY=

# Your Preview API Key AGILITY_API_PREVIEW_KEY=

Start The Site

To run the site locally, run npm run dev or yarn dev. This will use the Preview Key in your .env file.

If successful, your site's build should complete and you be able to view the site in your browser on http://localhost:3000.

Screen_Shot_2021-04-20_at_9.56.32_AM.png

Did you get a Build Error?

If you get an error during the build, check your log and ensure that you've entered your GUID and API Keys in your .env file.

2 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.