question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Add ability to run Lighthouse reports on logged in pages of app

See original GitHub issue

Is your feature request related to a problem? Please describe. I really like this plugin. One challenge is that most of my app is only available after login. I could have netlify run a lighthouse report on my /login page and my /signup pages but unless there is a mechanism to allow netlify to login or use some kind of token, I’m not able to use the plugin to run reports on most of my app.

Describe the solution you’d like I think there are a few ways it could solved. There could be an environmental variable for a session token or some mechanism to hit an endpoint with a username and password and get a session token so netlify could access post-login pages. Would it be possible to access environmental variables and include them in the config for the paths? if so, maybe I could store the session token in an environmental varibale in netlify and use it as a HTTP header when this plugin accesses a route.

Describe alternatives you’ve considered Setting up puppeteer independent of this plugin to run a lighthouse report. I’d rather use this plugin because then it could trigger on each deploy

Additional context Thank you for any thoughts! I originally posted a question about this on the netlify community board: https://community.netlify.com/t/lighthouse-plugin-reports-for-pages-that-require-login-to-my-app/31639/

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
erezrokahcommented, Apr 27, 2021

Hi @drewrwilson you can use any key/value for the headers. In your case it should be:

[[plugins]]
package = "@netlify/plugin-lighthouse"
[plugins.inputs.extra_headers]
X-Something-Session-Id = "some-uuid-goes-here"
X-Something-Token = "somewildstring"
[[plugins.inputs.audits]]
url = "https://something.tech/login"
1reaction
kaganjdcommented, Apr 22, 2021

@erezrokah that makes sense, thanks for laying it out. I’ll touch base with the customer to see if we can get a sample repo @drewrwilson whatttt?! Small world indeed 🌏 Would love to hear what public interest tech things you’re up to these days

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · netlify/netlify-plugin-lighthouse - GitHub
Contribute to netlify/netlify-plugin-lighthouse development by creating an ... Feature request: Add ability to run Lighthouse reports on logged in pages of ...
Read more >
Lighthouse overview - Chrome Developers
In Chrome DevTools. Easily audit pages that require authentication, and read your reports in a user-friendly format. ; From the command line.
Read more >
An Introduction To Running Lighthouse Programmatically
One of the simplest ways to run Lighthouse is through Chrome's DevTools Lighthouse panel. If you open your site in Chrome and then...
Read more >
Run Lighthouse Performance Audits on every Pull Request
You give Lighthouse a URL to audit, it runs a series of audits against the page, and then it generates a report on...
Read more >
How to Use Google Lighthouse to Improve Site Speed
Core Web Vitals are a set of metrics Google developed to measure web pages' page speed and overall user experience. In 2021, Google...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found