https://github.com/fiverr/lighthouse-scores-to-email
Send simple PageSpeed scores to your email
https://github.com/fiverr/lighthouse-scores-to-email
cli docker lighthouse pagespeed pagespeed-insights-api
Last synced: 23 days ago
JSON representation
Send simple PageSpeed scores to your email
- Host: GitHub
- URL: https://github.com/fiverr/lighthouse-scores-to-email
- Owner: fiverr
- Created: 2020-02-17T08:58:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-13T11:17:07.000Z (over 1 year ago)
- Last Synced: 2025-04-04T18:11:35.657Z (about 2 months ago)
- Topics: cli, docker, lighthouse, pagespeed, pagespeed-insights-api
- Language: JavaScript
- Homepage: https://hub.docker.com/r/fiverr/lighthouse-scores-to-email
- Size: 3.33 MB
- Stars: 10
- Watchers: 37
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# lighthouse-scores-to-email [](https://hub.docker.com/r/fiverr/lighthouse-scores-to-email) [](https://circleci.com/gh/fiverr/lighthouse-scores-to-email)
Get [Lighthouse scoring](https://developers.google.com/web/tools/lighthouse/v3/scoring) via [Google PageSpeed Insights](https://developers.google.com/speed/docs/insights/v5/about) delivered to your email.
| 
| -## Configurations
Add email and general configurations to `/configuration/config.js`
Add pages configurations to `/configuration/pages.json`Example configuration files
> #### configuration/pages.json
> ```json
> {
> "Example": "https://example.net/",
> "Start Page" : "https://www.start.co.il"
> }
> ```> #### configuration/config.json
> ```json
> {
> "email": {
> "to": "[email protected]",
> "authUser": "[email protected]",
> "authPassword": ""
> },
> "lightHouseApiKey": ""
>}
>```To load configurations during run time from external file, use docker volume.
```
-v "$(pwd)"/pages.json:/usr/src/app/configuration/pages.json
```## getting-started with Docker
```
docker pull fiverr/lighthouse-scores-to-email:latest
```Export your variables to the environment and pass them through alongside your pages.json file
```
docker run \
-v "$(pwd)"/pages.json:/usr/src/app/configuration/pages.json \
-e APIKEY \
-e AUTH_USER \
-e AUTH_PASSWORD \
-e EMAIL_TO \
-e STATSD_HOST \
-e STATSD_PORT \
fiverr/lighthouse-scores-to-email:latest
```Or send as config file
```
docker run \
-v "$(pwd)"/pages.json:/usr/src/app/configuration/pages.json \
-v "$(pwd)"/config.json:/usr/src/app/configuration/config.json \
fiverr/lighthouse-scores-to-email:latest
```## Get your credentials here
Get your [PageSpeed API key](https://developers.google.com/speed/docs/insights/v4/first-app).
Use Gmail with Google's [app passwords](https://support.google.com/accounts/answer/185833).
## Set up environment variables or configuration using config file
| Env Variable | Config File path | Value | Default
| - | - | - | -
| `APIKEY` | `lightHouseApiKey` | SpeedTest [API Key](https://developers.google.com/speed/docs/insights/v4/first-app) | __Mandatory__
| `AUTH_USER` | `email.authUser` | Email username | None
| `AUTH_PASSWORD` | `email.authPassword` | [App password](https://support.google.com/accounts/answer/185833) | None
| `EMAIL_TO` | `email.to` | Recipient Email address | None
| `EMAIL_FROM` | `email.from` | Sender Email address | `Lighthouse Gazette `
| `EMAIL_SUBJECT` | `email.subject` | Subject of the email | `Google LightHouse Report ✔`
| `EMAIL_HOST` | `email.host` | SMTP host | `smtp.gmail.com`
| `EMAIL_PORT` | `email.port` | SMTP port | `465`
| `STATSD_HOST` | `statsd.host` | StatsD hosname | None
| `STATSD_PORT` | `statsd.port` | StatsD port | `8125`
| `STATSD_PREFIX` | `statsd.prefix` | Custom prefix to metric | `lighthouse_scores_to_email`
| `SECURE` | `email.secure` | Should use SSL | `true`
| - | `categories` | [Lighthouse categories](https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed#category) | `['PERFORMANCE', 'SEO', 'ACCESSIBILITY', 'BEST_PRACTICES']`
| - | `strategies` | [Lighthouse strategies](https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed#category) | `['MOBILE', 'DESKTOP']`## Add links to your email (for example, links for grafana)
> #### configuration/config.json
> ```json
> {
> "email": {
> "list": [
> {
> "text": "Email provided by Fiverr SRE team",
> "url": "https://play.grafana.org/"
> },
> {
> "text": "View trends on Grafana dashborad",
> "url": "https://play.grafana.org/"
> }
> ]
> }
> }
>```