Skip to main content
Driver creates hosted sessions automatically. Most users should only pass type: "hosted". Use nodeId only when you need a later session to run on the same hosted node that served a previous session.

Reuse a Hosted Node

Every session response includes servedBy. Pass that value as nodeId in a later session:
const firstSession = await client.browser.session.create({ type: "hosted" });

await client.browser.session.stop({ sessionId: firstSession.sessionId });

const nextSession = await client.browser.session.create({
  type: "hosted",
  nodeId: firstSession.servedBy,
});
nodeId overrides country. If the hosted node is unavailable, the request fails instead of falling back to another node.