> For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt.

# Integrating Your Service Worker

- Custom Service Worker: Inject the path of your custom service worker file `(e.g. "./**/your-service-worker-filename" or "./your-service-worker-filename")` into the global variable `window.__rb_app.swUrl`. After injecting, output the variable to check if the path is correct. Then, in your service worker file, insert the line `importScripts("./notification-sw.js")`.

### Integration Code Example

- index.html

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta content="IE=edge" http-equiv="X-UA-Compatible" />
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <title></title>
    <script>
        window.__rb_app.swUrl = './**/your-service-worker-filename" or "./your-service-worker-filename'
    </script>
    <!--  other code  -->
  </head>
  <body></body>
</html>
```

- service-worker.js

```js
// service-worker.js
importScripts("./notification-sw.js")
/**
 * Your code
 */
```

### Important Notes

- The injection of window.\_\_rb_app.swUrl must occur before the closing of the `<head>` tag in index.html.
- Only self-developed integrations are supported; packaged integrations can be ignored.
- For any integration issues, please contact customer support for assistance.
