How to install a Service Worker
1 min read
Service Worker is a script that your browser runs in the background, separate from the Web, enabling features such as periodic synchronization, push notifications and even running offline.
To create the script, follow the step-by-step instructions below:
- In the VTEX Admin, go to Store Settings > Storefront > Checkout, or type Checkout in the search bar at the top of the page.
 - Click the icon of the desired site.
 - In the 
Codetab, click theNewbuttton. - Then click on 
File. - Fill in the file name exactly like: 
service-worker.js. - Click the 
Createbutton. - Set the feature.
 - Click the 
Savebutton. 
Although the file is in /files/service-worker.js, it receives the Service-Worker-Allowed header with the value /, which allows you to intercept requests from the site root.
For more information, see Google Developers Web Fundamentals.