Skip to main content

Install Argos with Gatsby

Setting up Argos in a Gatsby v4+ project.

The quickest way to use Argos with Gatsby is to use the dedicated plugin gatsby-plugin-argos.

On CI post-build, the plugin will take screenshots of every page and upload them on Argos. The Argos check will available on Github commit status.

1. Install

npm install --save-dev gatsby-plugin-argos argos-cli gatsby-plugin-screenshot puppeteer

2. Use your Argos token

Expose your ARGOS_TOKEN as environment variable.

3. Add the Argos plugin to Gatsby config

// in your gatsby-config.js
module.exports = {
plugins: [
...(process.env.CI
? [
{
resolve: "gatsby-plugin-argos",
options: {
token: process.env.ARGOS_TOKEN,

// CI branch name variable
branch: process.env.GITHUB_REF_NAME,

// CI commit hash
commit: process.env.GITHUB_SHA,
},
},
]
: []),
],
};

Read the example repository.