#19 - Tools: Auditing Your PWA
Tags: pwa, pwabuilder, webdev, beginners
Published: 2022-03-05 02:32:13

---
title: #19 - Tools: Auditing Your PWA
published: true
description: Let's continue our #30DaysOfPWA journey by learning how to audit your PWA with PWABuilder and Webhint! https://aka.ms/learn-pwa/30days-blog
tags: pwa, pwabuilder, webdev, beginners
canonical_url: https://microsoft.github.io/win-student-devs/#/30DaysOfPWA/dev-tools/05
series: Learn Progressive Web Apps with 30DaysOfPWA
cover_image: https://microsoft.github.io/win-student-devs/30DaysOfPWA/dev-tools/_media/day-05.jpg
---

Welcome to Day 19 of #30DaysOfPWA! New to the series? Three things you can do to catch up:

 * Read the kickoff post below for context.
 * Watch the [GitHub Repository](https://github.com/microsoft/win-student-devs) for updates.
 * Bookmark [#30DaysOfPWA Blog](https://aka.ms/learn-pwa/30Days-blog) for resources.

{% link https://dev.to/azure/welcome-to-30daysofpwa-2e54 %}

This is a shortened version of [this canonical post](https://microsoft.github.io/win-student-devs/#/30DaysOfPWA/dev-tools/05) for the #30DaysOfPWA. 

---

## About The Author

Today's post is authored by _Justin Willis_ - a member of the PWABuilder team at Microsoft. Follow Justin at [@justinwillis96](https://twitter.com/justinwillis96) or here on dev.to.

{% user lilpwa %}

---

Welcome to day **week 3 day 5**  of the [30 Days of PWA](https://aka.ms/learn-pwa/30Days-blog) series! In today's blog post, we will be learning how to audit a PWA and use those audits to help improve its user experience.

## Why audit a PWA

So, why should we audit our PWA anyways? And what does this even mean?

When we are talking about auditing our PWA, we mean using tools to ensure that our PWA is: 

- Installable from the browser
- Ready to submit to app stores such as the Microsoft Store
- Accessible
- Fast
- Follows cross-browser development best practices

We do this to ensure our PWA is the best it can be for users. Users want high quality apps that are accessible, fast and discoverable, and auditing ensures we are meeting these requirements.

Today we are going to use PWABuider, Webhint and Edge Devtools to audit our PWA, let's dive in!

## Audit with PWABuilder

Let's start with PWABuilder. The focus of the audit PWABuilder does is to ensure our PWA is high-quality, installable, and ready to publish to app stores like the Microsoft Store. To do this, PWABuilder looks at the:

- Web Manifest
- Service Worker
- HTTPS Setup

and audits them based on a set of requirements. 
These also happen to be the technical essentials you need for an app to be considered a PWA. 

| Web Manifest | Service Worker | Security
| ------- | ----------- | ----------- |
| Properly linked + registered | Properly linked + registered | Uses HTTPS
| Contains required fields for installation | Works Offline | Valid HTTPS Setup
| Icons follow best practices | Suggested features to improve our offline experience | No HTTP content on page
| Suggested fields to improve our PWA or enable new features | | |

Each section above has a set of Required audits. These are audits that are required to be in the app stores and for installation from the browser. There are also Recommended and Optional audits for each section. These audit things such as, for example, manifest fields you can add to improve the installation experience of your PWA, but are not required.

To get started with PWABuilder's audits, you can use either [PWABuilder](https://aka.ms/learn-PWA/30Days-3.5/pwabuilder.com) or the [PWA Studio VSCode Extension](https://aka.ms/learn-PWA/30Days-3.5/pwa-studio).

### Getting audits from pwabuilder.com
Already have a published and live PWA that you want to audit? 

- Grab our URL and head over to https://aka.ms/learn-PWA/30Days-3.5/pwabuilder.com
- Enter the URL to our PWA on the homepage of pwabuilder.com and click Start
![We have entered our URL into the input on the homepage of PWABuilder](_media/05/enter-url.png)
- pwabuilder.com will now analyze our PWA and return our audits
![A screenshot of the report-card page in PWABuilder showing our audits](https://microsoft.github.io/win-student-devs/30DaysOfPWA/dev-tools/_media/05/enter-url.png)

Each section is given an overall score. If we click on that section, it will give us more details on our score, including what we can add or change to get a better score. Towards the bottom of the page, we can see our total score.
![A screenshot showing the total score located towards the bottom of the report page](https://microsoft.github.io/win-student-devs/30DaysOfPWA/dev-tools/_media/05/report-card.jpeg)

If our total score is green, then our PWA is ready to publish and we are ready to click next to start packaging our PWA.

If our total score is yellow this means that our PWA is most likely ready to publish, but may be missing out on Recommended Features such as having a `background_color` in our Web Manifest. The section that is lowering our score will also have a yellow score. At that point, we should click on it to see what we need to add.

If our score is red, this means our PWA is not ready to publish to the web or app stores and needs additional work. The section with the problem will also have a red score. As above, we can click on that section to see what needs to be added next.

### Getting our audits with PWA Studio
PWA Studio enables us to audit with PWABuilder during development, not just after our PWA has gone live.

- Install PWA Studio from the [VSCode Marketplace](https://aka.ms/learn-PWA/30Days-3.5/pwa-studio)
- Open our codebase in VSCode
- Click the PWABuilder icon on the left side of VSCode
![The PWABuilder icon on the left side of VSCode](https://microsoft.github.io/win-student-devs/30DaysOfPWA/dev-tools/_media/05/total-score.png)
- We will now see our audits

![The audits panels in PWA Studio](https://microsoft.github.io/win-student-devs/30DaysOfPWA/dev-tools/_media/05/icon-on-left.png)

PWA Studio uses a simpler way of showing audits. As it shows in the above screenshot, there are three sections again, but slightly different this time: Web Manifest, Service Worker, Store Ready.

For each section, you will see a list of items. If that item is good to go, it will have a checkmark next to it, if not, it will have a caution symbol. For every item, you can click on the info icon in that item to learn more about it and how to fix the audit.

For the best PWA, we recommend checking off as many items as you can. If you are missing something that is required, PWA Studio will give you an alert when trying to publish to the web or package your PWA for the app stores.

## Audit a PWA with Webhint
You may have heard of [Webhint](https://aka.ms/learn-PWA/30Days-3.5/webhint.io) before, but did you know it's audits are built into the [Issues panel in Edge devtools?](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/issues)

The Issues panel allows you to quickly see any of the issues webhint detected in our app. On top of this, it also tells you which HTML element the problem affects and how to fix it.

![The issues panel in Edge devtools showing an accessibility issue](https://microsoft.github.io/win-student-devs/30DaysOfPWA/dev-tools/_media/05/webhint.png).

To use it:
- Open our app in Edge
- Open [Edge devtools](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium)
- Select the Issues tab. The Issues panel opens with issues grouped into different categories.
- Refresh our app, because some issues are reported based on network requests. Notice the updated count in the Issues counter.

## Audit performance with Lighthouse and Devtools

We are now ready to audit our app's loading performance, or how fast our PWA loads on different devices with varying network connections.

**Note** Edge devtools can also help you evaluate and improve our apps runtime performance. Check our [docs](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/evaluate-performance) to learn more.

Edge devtools has the [Lighhouse](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/speed/get-started) tool built in. Lighthouse can quickly evaluate our apps loading performance and give us suggestions on how to make it load faster. It will evaluate our app running on our device, but with CPU throttling and Network throttling to better match what you users experience. When talking about loading performance, it is important to remember that we need to ensure our apps load fast on our users devices, not just our development machines. Lighthouse enables us to do this directly from our development device.

To get started auditing our loading performance with Lighthouse:

- Open our app in Edge
- Open [Edge devtools](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium)
- Open the Lighthouse tab in devtools 

![A screenshot of the lighthouse tab at the top of devtools](https://microsoft.github.io/win-student-devs/30DaysOfPWA/dev-tools/_media/05/lighthouse.png)

- Click `Generate Report` to get a baseline report
- Analyze the report and make the suggested changes to our app.

For a full walkthrough on using Lighthouse to improve the loading performance of our application, check our [docs](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/speed/get-started). 


Using these tools, we can quickly make changes to our PWA to ensure it provides the best experience possible for our users. And, because PWAs are instantly updateable like normal websites, we can get these changes out to our users quickly!

In our next post, we’ll dive into converting our existing website to a PWA!

## Resources
- [pwabuilder.com](https://aka.ms/learn-PWA/30Days-3.5/pwabuilder.com)
- [PWA Studio VSCode Extension](https://aka.ms/learn-PWA/30Days-3.5/pwa-studio)
- [Edge devtools](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium)
- [Evaluate Runtime Performance](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/evaluate-performance)
- [Evaluate Loading Performance](https://aka.ms/learn-PWA/30Days-3.5/docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/speed/get-started)

---

Want to read more content from Microsoft technologists? Don't forget to follow Azure right here on dev.to:

{% org azure %}

---