Browser Profiles API Docs (#4087)

This commit is contained in:
Marc Kelechava
2025-11-25 18:29:23 -08:00
committed by GitHub
parent 0a12f4dfb8
commit 849b715aee
3 changed files with 139 additions and 0 deletions

View File

@@ -835,3 +835,73 @@ const skyvern = new SkyvernClient({ apiKey: "YOUR_API_KEY" });
const browserSessions = await skyvern.getBrowserSessions();
console.log(browserSessions);
"""
# Browser Profiles
CREATE_BROWSER_PROFILE_CODE_SAMPLE_PYTHON = """from skyvern import Skyvern
skyvern = Skyvern(api_key="YOUR_API_KEY")
# Create a browser profile from a persistent browser session
browser_profile = await skyvern.browser_profiles.create_browser_profile(
name="My Profile",
browser_session_id="pbs_123",
)
print(browser_profile)
# Or create from a workflow run with persist_browser_session=True
browser_profile = await skyvern.browser_profiles.create_browser_profile(
name="My Profile",
workflow_run_id="wr_123",
)
print(browser_profile)
"""
CREATE_BROWSER_PROFILE_CODE_SAMPLE_TS = """import { SkyvernClient } from "@skyvern/client";
const skyvern = new SkyvernClient({ apiKey: "YOUR_API_KEY" });
// Create a browser profile from a persistent browser session
const browserProfile = await skyvern.browserProfiles.createBrowserProfile({
name: "My Profile",
browser_session_id: "pbs_123",
});
console.log(browserProfile);
// Or create from a workflow run with persist_browser_session=True
const browserProfile2 = await skyvern.browserProfiles.createBrowserProfile({
name: "My Profile",
workflow_run_id: "wr_123",
});
console.log(browserProfile2);
"""
GET_BROWSER_PROFILES_CODE_SAMPLE_PYTHON = """from skyvern import Skyvern
skyvern = Skyvern(api_key="YOUR_API_KEY")
browser_profiles = await skyvern.browser_profiles.list_browser_profiles()
print(browser_profiles)
"""
GET_BROWSER_PROFILES_CODE_SAMPLE_TS = """import { SkyvernClient } from "@skyvern/client";
const skyvern = new SkyvernClient({ apiKey: "YOUR_API_KEY" });
const browserProfiles = await skyvern.browserProfiles.listBrowserProfiles();
console.log(browserProfiles);
"""
GET_BROWSER_PROFILE_CODE_SAMPLE_PYTHON = """from skyvern import Skyvern
skyvern = Skyvern(api_key="YOUR_API_KEY")
browser_profile = await skyvern.browser_profiles.get_browser_profile("bp_123")
print(browser_profile)
"""
GET_BROWSER_PROFILE_CODE_SAMPLE_TS = """import { SkyvernClient } from "@skyvern/client";
const skyvern = new SkyvernClient({ apiKey: "YOUR_API_KEY" });
const browserProfile = await skyvern.browserProfiles.getBrowserProfile("bp_123");
console.log(browserProfile);
"""
DELETE_BROWSER_PROFILE_CODE_SAMPLE_PYTHON = """from skyvern import Skyvern
skyvern = Skyvern(api_key="YOUR_API_KEY")
await skyvern.browser_profiles.delete_browser_profile("bp_123")
"""
DELETE_BROWSER_PROFILE_CODE_SAMPLE_TS = """import { SkyvernClient } from "@skyvern/client";
const skyvern = new SkyvernClient({ apiKey: "YOUR_API_KEY" });
await skyvern.browserProfiles.deleteBrowserProfile("bp_123");
"""