-
Hello, I am looking to set up Percy on an APP that requires token authentication. The token is stored directly in the localStorage. My problem is that currently all screenshots return the login page. Is it possible with Percy to inject a token in the localStorage when taking screenshots? thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @alanltr! Which SDK are you using or how are you taking snapshots of your app? For most SDKs, you can set However, web storage objects like |
Beta Was this translation helpful? Give feedback.
Hey @alanltr!
Which SDK are you using or how are you taking snapshots of your app? For most SDKs, you can set
localStorage
using your existing test framework API.However, web storage objects like
localStorage
are not sent to the server with each request, and can only be accessed by client-side JavaScript APIs. If your app reads the token from the web storage data and uses it to authenticate requests, it is probably sending the token using a request header. Request headers can be sent per-snapshot withdiscovery.requestHeaders
, or using the accompanying config file option.