> For the complete documentation index, see [llms.txt](https://docs.adena.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adena.app/integrations/detect-events/detect-a-network-change.md).

# Detect a Network Change

The web application must keep track of which network Adena is connected to at all times, as Adena submits all requests to the current network. Adena provides a function to detect a change when a user tweaks the network settings in Adena.

#### Code

```javascript
adena.On("changedNetwork", (network: string) => void);
```

#### **Params**

<table><thead><tr><th width="173">Key</th><th width="313.3333333333333">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>key</code></td><td>'<code>changedNetwork'</code></td><td>The event key of '<code>changedNetwork'</code></td></tr><tr><td><code>function</code></td><td><code>(network: string) => void</code></td><td>The function that gets triggered by the event</td></tr></tbody></table>

#### Sample Request

```javascript
//this will emit a network change when the user changes the network settings on Adena
adena.On("changedNetwork", (network) => {
  console.log("changed network is " + network)
});
```

#### **Networks (chainID)**

<table><thead><tr><th width="173">ID</th><th>Network</th></tr></thead><tbody><tr><td><code>test3</code></td><td>Gnoland Network (Testnet 3)</td></tr><tr><td><code>test2</code></td><td>Gnoland Network (Testnet 2)</td></tr><tr><td><code>dev</code></td><td>Gnoland Network (Local)</td></tr></tbody></table>


---

# 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:

```
GET https://docs.adena.app/integrations/detect-events/detect-a-network-change.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
