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

# Chrome Extension SDK Setup

> Instructions for adding the OneSignal Chrome App SDK to your Chrome Extension

<Danger>As of May 2026, this documentation will no longer be updated and may contain broken links or outdated information.</Danger>

<Warning>
  Our Chrome App Extension is no longer being updated, however it is open source if you would like to contribute:
  [https://github.com/OneSignal/OneSignal-ChromeApp-SDK](https://github.com/OneSignal/OneSignal-ChromeApp-SDK)
</Warning>

## Required for setup

* [OneSignal Account](https://onesignal.com)
* OneSignal App ID, available in [Settings > Keys & IDs](./keys-and-ids)
* A Google Server API Key. See [Generating a Google Server API Key](./android-firebase-credentials) for details

### 1. Import OneSignal

**1.1** Download the latest [OneSignal Chrome App SDK](https://github.com/one-signal/OneSignal-ChromeApp-SDK/releases).

**1.2** Copy `OneSignal.js` to your App/Extension project folder.

**1.3** Continue to **2A** if you have a Chrome App.
Or continue to **2B** if you have a Chrome Extension.

### 2A. Add OneSignal to a Chrome App

**2A.1** Open your `manifest.json` and add `OneSignal.js` before you own background.js.

```json theme={null}
"app": {
    "background": {
      "scripts": ["OneSignal.js", "background.js"]
    }
  },
```

**Background HTML Page**

If your `manifest.json` contains a background `page` instead of `scripts`, then add `OneSignal.js` to your background HTML page before your own `background.js`.

**2A.2** In your `manifest.json` add the following 5 permissions to your permissions array.

```json theme={null}
"permissions": ["gcm", "storage", "notifications", "identity", "browser"],
```

**2A.3** Continue to step 3.

### 2B. Add OneSignal to a Chrome Extension

**2B.1** Open your `manifest.json` and add `OneSignal.js` before you own `background.js`.
*Create new blank `background.js` file if you don't have a background script already.*

```json theme={null}
"background": {
  "persistent": false,
  "scripts": ["OneSignal.js", "background.js"]
},
```

**2B.2** In your `manifest.json`, add the following permissions to your permissions array:

```json theme={null}
"permissions": ["gcm", "storage", "notifications", "identity"],
```

**Permission Warnings**

Adding some of these permissions, if they were not already present, may require users to re-allow your extension after an update. The list of new permissions that may cause this is available [here](https://developer.chrome.com/extensions/permission_warnings).

Note that in Chrome 50, there is a bug that causes the "notifications" permission to cause this warning. You can find our more about this bug [here](https://bugs.chromium.org/p/chromium/issues/detail?id=603822\&q=component%3APlatform%3EExtensions%20permission\&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified).

### 3. Add Required Code

**3.1** Open your `background.js` file and add the following line outside of any function so it runs when your app/extension is loaded.

Replace `appId` with your OneSignal App Id, and `googleProjectNumber` with your own as well.

```javascript theme={null}
OneSignal.init({appId: "b2f7f966-d8cc-11e4-bed1-df8f05be55ba",
                googleProjectNumber: "703322744261"});
```

<Check>
  You should be all set to go with your Chrome App or Extension app.
</Check>
