Skip to content

Get widths from the config file #810

Answered by wwilsman
klamping asked this question in Support
Discussion options

You must be logged in to vote

Hey @klamping!

In the context of the Cypress SDK, you could potentially utilize @percy/sdk-utils (a dependency of the SDK). Here's a how you would read the config, but only after isPercyEnabled() is called and returns true.

Casting aside any SDK, while Percy is running you can access its loaded config from either of two endpoints: http://localhost:5338/percy/healthcheck or http://localhost:5338/percy/config.

But this is only possible while Percy is running. If you're looking to read the config file regardless of if Percy is running, I would recommend just reading and parsing the file directly. If using a .percy.js config file, you could just import it like any other JS file. If using any …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@klamping
Comment options

Answer selected by klamping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants