Menu
Feedback
Start here
Tutorials
Developer portal

Known Issues
Support Rules
Troubleshooting

Frequently Asked Questions
Announcements
Tutorials
Tutorials
Explore in-depth tutorials for operating your VTEX store.
Tutorials
Storefront
Store Settings - Storefront
How to install a Service Worker
How to install a Service Worker

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:

  1. In the VTEX Admin, go to Store Settings > Storefront > Checkout, or type Checkout in the search bar at the top of the page.
  2. Click the icon of the desired site.
  3. In the Code tab, click the New buttton.
  4. Then click on File.
  5. Fill in the file name exactly like: service-worker.js.
  6. Click the Create button.
  7. Set the feature.
  8. Click the Save button.

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.

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX community.
Join our community
Request support from VTEX
For personalized assistance, contact our experts.
Open a support ticket
GithubDeveloper portalCommunityFeedback