Any other platform

Don't see your platform listed? No problem! We have a CLI tool which offers multiple other ways to integrate Pixeleye into your workflow.

Our CLI supports the following methods:

  • directory upload - Upload a directory of images to Pixeleye, e.g. screenshots from your e2e tests
  • storybook - Run a Storybook server and upload the stories to Pixeleye
  • exec - Run a command and upload the output to Pixeleye

Installing the CLI

Terminal
npm install pixeleye --save-dev

Terminal
npm install pixeleye --save-dev

Get a project token

You can get a project token from the Pixeleye dashboard. You will need this to authenticate your project with Pixeleye.

See Getting Started for more information.

Create a pixeleye.config.{js,ts} file

pixeleye.config.js
/** @type {import('pixeleye').Config} */
const config = {
token: "YOUR_PROJECT_TOKEN",
// or
// token: process.env.PIXELEYE_PROJECT_TOKEN,
// ...
};

export default config;

pixeleye.config.js
/** @type {import('pixeleye').Config} */
const config = {
token: "YOUR_PROJECT_TOKEN",
// or
// token: process.env.PIXELEYE_PROJECT_TOKEN,
// ...
};

export default config;

Upload a directory of images

Most e2e frameworks include their own screenshot functionality. You can use this to take screenshots of your application and upload them to Pixeleye.

We only support PNG images at the moment.

Run the CLI

Terminal
pixeleye upload ./path/to/screenshots

Terminal
pixeleye upload ./path/to/screenshots

Snapshot metadata

By naming your screenshots with the format {name}--{variant}.png you can add metadata to your snapshots.

You can escape the -- by using \-\- in the name.

Note: We don't currently support any other meta data like viewport size or device type.

Was this page helpful?

Last modified: 3/10/2024