---
title: "createEdgeNetwork"
source: "https://browserpod.io/docs/reference/BrowserPod/createEdgeNetwork"
---

# createEdgeNetwork

Create an Edge network that routes a Pod's traffic through BrowserPod Edge using an API key.

```ts
class BrowserPod {
  static async createEdgeNetwork(opts: { apiKey: string }): Promise<PodNetwork>;
}
```

Creates an Edge network instance that routes the Pod’s outbound HTTP, HTTPS, and WebSocket traffic, and other TCP connections to its allowed domains, through BrowserPod Edge. It also enables incoming connections to services running inside the Pod via [Portals](https://browserpod.io/docs/understanding-browserpod/portals.md). An Edge network is charged per connected hour, in blocks of 10 tokens. See [Networking](https://browserpod.io/docs/understanding-browserpod/networking.md) for an overview.

## Parameters

- **opts (`object`)** - Configuration options.

## Options

- **apiKey (`string`)** - The [API key](https://browserpod.io/docs/understanding-browserpod/api-key.md) used to authenticate requests. The network can reach its allowed domains: BrowserPod’s default domains, such as the npm registry and GitHub, or the ones you choose with Edge Pro in the [BrowserPod console](https://console.browserpod.io/).

## Returns

A [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves to a `PodNetwork` instance. Pass it to [`BrowserPod.boot`](https://browserpod.io/docs/reference/BrowserPod/boot.md) as the `network` option.

## Example

```js
const network = await BrowserPod.createEdgeNetwork({ apiKey: "your_key_here" });
const pod = await BrowserPod.boot({ network });
```

Calling `BrowserPod.boot({ apiKey })` is shorthand for this.
