Control which nodes serve your browser sessions using node IDs and session types.
Session Types
Specify the type of infrastructure for your session:
| Type | Description | Best For |
|---|
consumer_distributed | Runs on real consumer devices | Maximum stealth, anti-detection |
hosted | Runs in our data centers | Consistent performance, reliability |
const session = await client.browser.session.create({
type: "hosted",
});
Targeting Specific Nodes
Every session response includes a servedBy field with the node ID. Reuse this to target the same node:
// Create first session
const session1 = await client.browser.session.create();
console.log("Node:", session1.servedBy); // "node-us-east-abc123"
// Stop when done
await client.browser.session.stop({ sessionId: session1.sessionId });
// Later — target the same node
const session2 = await client.browser.session.create({
nodeId: session1.servedBy,
});
Combining Filters
Use multiple parameters together:
const session = await client.browser.session.create({
country: "US", // Geographic filter
type: "hosted", // Infrastructure type
nodeId: "node-123", // Specific node (overrides country)
});
If you specify a nodeId, that takes precedence over country. If the node
is offline or unavailable, the request will fail rather than fall back to
another node.
Node Availability
- Nodes may go offline temporarily
- Distributed nodes have variable availability
- Hosted nodes offer high uptime guarantees