Browser Profiles API Docs (#4087)
This commit is contained in:
@@ -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");
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user