> For the complete documentation index, see [llms.txt](https://partners.tray.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partners.tray.com.br/themes/construindo-seu-template/otimizar-e-medir/utilizando-pwa-na-loja.md).

# Utilizando PWA na loja

### O que é PWA?

PWA, em inglês Progressive Web App, é uma aplicação híbrida entre web e mobile. Tem a capacidade de transformar os navegadores (páginas web) em aplicativos mobile, combinando os recursos oferecidos pela maioria dos navegadores modernos com os benefícios da experiência móvel. Em resumo, é uma aplicação web com tecnologias que permitem termos a experiência de uso muito próxima da oferecida pelos aplicativos mobile sem a necessidade de instalação.

### **Como aplicar?**

Disponibilizamos a possibilidade de inclusão do arquivo `service_worker.js` . Com esse arquivo disponível é possível tornar a loja uma PWA (Progressive Web App), onde ele deve estar localizado na raiz da loja para que funcione corretamente. Para implementar este recurso é necessário criar o arquivo com o nome de `service_worker.js` diretamente a pasta **JS.** Caso o tema contenha esse arquivo ele será carregado diretamente na raiz do domínio. &#x20;

```html
 Ex:  www.minhaloja.commercesuite.com.br/service_worker.js
```

Para ter acesso a este arquivo em um tema preview (Não publicado)

```html
 Ex:  www.minhaloja.commercesuite.com.br/service_worker.js?&opencode_theme=5bc9e193eca1f&4884
```

No caso o arquivo `manifest.json` você poderá salvar em qualquer pasta, não necessariamente na raiz.

Será como um upload de um arquivo qualquer pelo opencode, e quando for usar a tag abaixo, basta adicionar no `href` o caminho que você inseriu no arquivo.

```html
 <link rel="manifest" href="caminhodapasta/manifest.json">
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://partners.tray.com.br/themes/construindo-seu-template/otimizar-e-medir/utilizando-pwa-na-loja.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
