createEdgeNetwork

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

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. An Edge network is charged per connected hour, in blocks of 10 tokens. See Networking for an overview.

Parameters

  • opts (object) - Configuration options.

Options

  • apiKey (string) - The API key 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.

Returns

A Promise that resolves to a PodNetwork instance. Pass it to BrowserPod.boot as the network option.

Example

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

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