import { GravixLayer } from 'gravixlayer';
const client = new GravixLayer();
const sandbox = await client.runtime.create({ template: 'browser-small' });
const browser = await sandbox.browser.open();
const bid = browser.browserId;
// An isolated session — separate cookies from the default context
const ctx = await sandbox.browser.contextCreate(bid);
const tab = await sandbox.browser.targets(bid, {
url: 'https://example.com',
contextId: ctx.contextId,
});
console.log(tab.targetId, tab.targets[0]?.contextId);
console.log((await sandbox.browser.contexts(bid)).map((c) => c.contextId));
await sandbox.browser.contextDelete(bid, ctx.contextId); // jars go with it