title | description |
---|---|
Config |
Options available in the Pixeleye config file |
This file can be used to configure Pixeleye. We default to looking at the root of a package (where the package.json
is located) for this file.
This file should export a Config
object. It can be a function that returns a Config
object or a Config
object itself.
{% tabs %}
{% tab label="TypeScript" %}
import { Config } from "pixeleye";
const config: Config = {
token: "YOUR_PROJECT_TOKEN",
// or
// token: process.env.PIXELEYE_PROJECT_TOKEN!,
// ...
};
export default config;
{% /tab %}
{% tab label="JavaScript" %}
const config = {
token: "YOUR_PROJECT_TOKEN",
// or
// token: process.env.PIXELEYE_PROJECT_TOKEN,
// ...
};
export default config;
{% /tab %}
{% /tabs %}
- Type:
string
- Default:
undefined
The project token is used to authenticate your project with Pixeleye. You can get a project token from the Pixeleye dashboard. You set it to an environment variable such as process.env.PIXELEYE_PROJECT_TOKEN if you want to keep it out of your codebase.
- Type:
string
- Default:
https://api.pixeleye.io
The endpoint where the Pixeleye API is running. This is only required if you are self-hosting Pixeleye.
- Type:
string
- Default:
3003
The port for which the Pixeleye booth will be running on. Pixeleye booth is a local server that runs on your machine and is responsible for capturing the screenshots across different devices. You should only change this if you have a conflict with another service running on the same port.
- Type:
DeviceDescriptor[]
- Default:
[devices["Desktop Chrome"], devices["Desktop Firefox"], devices["Desktop Safari"], devices["Desktop Edge"]]
The devices that you want to capture screenshots for. Use our built-in devices object (import { devices } from "pixeleye") or pass your own custom devices.
- Type:
string
- Default:
#FF00FF (pink)
The color that you want to use for masking elements. This can be overridden on a per snapshot basis.
- Type:
string
- Default:
undefined
The CSS that you want to inject into the page before capturing the screenshot. This can be overridden on a per snapshot basis. However, css defined per snapshot will be combined with this css but with a higher specificity.
- Type:
boolean
- Default:
false
Wait for the build to finish processing before exiting. We will output the status of the build once it has finished processing.
- Type:
object
- Default:
undefined
Storybook specific options.
- Type:
StorybookVariant[]
- Default:
undefined
An array of variants that you want to capture screenshots for.
- Type:
string
- Default:
undefined
The name of the variant. This will make up part of the snapshots name.
- Type:
string
- Default:
undefined
Optional search params to append to the storybook URL when capturing the screenshot.
[{ name: "Dark", params: "?globals=theme:dark" }, { name: "Light", params: "?globals=theme:light" }]
This will capture screenshots for both the dark and light theme if using storybooks theme addon.