Scan PageSpeed Insights of your website, send a slack notification with the result each time you deployed your application
- Create an app on your slack: https://api.slack.com/apps?new_app=1
- Click on Incoming Webhooks and toggle On
- Add New Webhook to Workspace => Link your channel
- Copy the url of your webhook
https://hooks.slack.com/services/******/*****/******
- Add the
nuxt-insights
dependency withyarn
ornpm
to your project - Add
nuxt-insights
to thebuildModules
section ofnuxt.config.js
- Configure it:
Key | Type | Default | Description |
---|---|---|---|
webhookUrl | String | Mandatory | The slack webhook url |
url | String | Mandatory | The url of the site you want to scan |
fields | Object | ||
-notation | Boolean | true | Score |
-fieldData | Boolean | true | * fieldData |
-laboratoryData | Boolean | true | * laboratoryData |
-opportunities | Boolean | true | * opportunities |
fieldData: First Contentful Paint, First Input Delay (FID), Largest Contentful Paint (LCP), Cumulative Layout Shift (CLS)
laboratoryData: First Contentful Paint, Time to Interactive, Speed Index, Total Blocking Time, Largest Contentful Paint, Cumulative Layout Shift
opportunities: These suggestions can help your page load faster. However, they do not have a direct impact on the performance score.
{
buildModules: [
['nuxt-insights', {
webhookUrl: 'https://hooks.slack.com/services/******/*****/******',
url: 'https://www.google.com',
// optional
fields: {
notation: true,
fieldData: true,
laboratoryData: true,
opportunities: true
}
}]
]
}
Copyright (c) Joffrey Berrier joffrey.berrier@gmail.com