> ## Documentation Index
> Fetch the complete documentation index at: https://docs.platform.arb.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Get service worker JavaScript

> Returns the service worker JavaScript code required for the demo page to handle push notifications. This script listens for push events and displays notifications to the user.



## OpenAPI

````yaml api-reference/push.yaml get /demo/sw.js
openapi: 3.0.3
info:
  title: push
  description: >-
    The Push service keeps track of which user browsers have signed up to
    receive notifications and how to reach them using VAPID. Other services tell
    it when a notification should be sent, and it delivers that message directly
    to the user's browser.
  version: 1.0.0
servers:
  - url: https://push.platform.arb.inc
security: []
tags:
  - name: /
  - name: demo
  - name: internal
  - name: vapid-keys
  - name: web-push
paths:
  /demo/sw.js:
    get:
      tags:
        - demo
      summary: Get service worker JavaScript
      description: >-
        Returns the service worker JavaScript code required for the demo page to
        handle push notifications. This script listens for push events and
        displays notifications to the user.
      operationId: getDemoServiceWorker
      responses:
        '200':
          description: Service worker JavaScript code
          headers:
            Content-Type:
              schema:
                type: string
                example: application/javascript
              example: application/javascript
            Service-Worker-Allowed:
              schema:
                type: string
                example: /
              example: /
          content:
            application/javascript:
              schema:
                type: string

````