> For the complete documentation index, see [llms.txt](https://doc.batch.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.batch.com/developer/sdk/web/testing-integration.md).

# Testing your integration

### Allowed Origins

This allows you to test your implementation on domains declared in the *"Allowed origins"* field in the *"Settings > Channels > Push > Web"* section of your dashboard.

![Allowed origins](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2FJndVI4cXqfis6vsKMxB6%2Fscreen_web_allowed_origins.png?alt=media\&token=93936fd0-7a26-4eca-9fa7-dca8b990d029)

### Development environments

While the SDK requires a secure environment on the web, browsers have an exception for `localhost` and `*.localhost` origins where they're considered as secure even though you're using plaintext HTTP to access them. The SDK will detect this and work as expected.

If you do use a secure connection to access your local environment or a preproduction one on the web, please note that granting a temporary security exception using your browser's prompt will **NOT** work as browsers will disable the Push feature.

To fix this:

* For `localhost` connections: either use plaintext `HTTP` or use a tool like [mkcert](https://github.com/FiloSottile/mkcert) to create and install a self signed certificate.
* For remote (such as preproduction) environments: use Let's Encrypt or issue a self signed root CA that you will have to trust on your test computers.

### Showing public identifiers

A modal can be shown on your website to display the following identifiers:

* Installation ID
* Custom User ID
* Push subscription status
* Registration Token

```js
batchSDK('ui.showPublicIdentifiers')
```

![Public identifiers modal screenshot](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2FrumIY2betL57XGwuSTnH%2Fpublic_identifiers.png?alt=media\&token=90f24711-6c76-4dc8-9206-9c0e3483dfb9)

### Finding your ID

You can find the Installation ID of your device by calling:

```javascript
batchSDK((api) => { 
  api.getInstallationID().then((id) => {
    console.log(id) 
  }) 
})
```

This example directly prints it to your browser's debug console.

{% hint style="success" %}
Tip: In development mode, Batch already prints the installation ID to the console.
{% endhint %}

You can also trigger a modal that displays your Installation ID and your Custom User ID: [Showing public identifiers](#showing-public-identifiers).

### Log your configuration tag

You can log the web push configuration tag in your browser's console by calling:

```javascript
batchSDK((api) => { 
  console.log(api.getConfiguration()) 
})
```

### Debug tool

Batch provides a simple [**debug tool**](https://doc.batch.com/getting-started/features/dashboard/05-settings/01-app-settings#debug-tools) that allows you to test your integration (⚙ Settings → Debug), and send yourself test notifications.

It also shows all the data available for a specific user ID:

* **Token**: Find the token of a specific device.
* **Custom user ID**: Check if your [custom user ID implementation](/developer/sdk/web/profile-data/custom-user-id.md) is working correctly.
* **Native attributes**: See the installation date, last session date, country and more information on a specific user / install.
* **Custom data**: If you send additional data on your users through the [Custom Data API](/developer/api/mep/custom-data-api.md).

![Debug tool](https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2F43KwdZVFMXzv6P64knBX%2Fdashboard_web_debug_screenshot.png?alt=media\&token=86ab52bf-535c-4531-89a6-8036a87c97d1)

### Common issues and integration checklist

If you encounter any issue during your testing, you will likely find an answer in this guide: [How can I test my web push integration?](/developer/technical-guides/how-to-guides/web/how-to-test-my-web-push-integration.md).

It also provides a comprehensive checklist of all elements you should review before going live.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.batch.com/developer/sdk/web/testing-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
