Profiles are supported on hosted sessions. Use
type: "hosted" when creating a session with a profile.Create a Session with a Profile
const session = await client.browser.session.create({
type: "hosted",
profile: {
name: "my-profile",
persist: true,
},
});
resp = requests.post(
"https://api.driver.dev/v1/browser/session",
headers={
"Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}",
"Content-Type": "application/json",
},
json={
"type": "hosted",
"profile": {
"name": "my-profile",
"persist": True,
},
},
)
resp.raise_for_status()
session = resp.json()
curl -X POST "https://api.driver.dev/v1/browser/session" \
-H "Authorization: Bearer $DRIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"hosted","profile":{"name":"my-profile","persist":true}}'
Profile Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Required profile name. Reuse this name to load the same profile later. |
persist | boolean | Save profile changes when the session stops. |
List Profiles
const { profiles } = await client.browser.profiles.list();
resp = requests.get(
"https://api.driver.dev/v1/browser/profiles",
headers={"Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}"},
)
resp.raise_for_status()
print(resp.json())
curl "https://api.driver.dev/v1/browser/profiles" \
-H "Authorization: Bearer $DRIVER_API_KEY"
Delete a Profile
const result = await client.browser.profiles.delete({
profileName: "my-profile",
});
resp = requests.delete(
"https://api.driver.dev/v1/browser/profile",
headers={"Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}"},
params={"profileName": "my-profile"},
)
resp.raise_for_status()
print(resp.json())
curl -X DELETE "https://api.driver.dev/v1/browser/profile?profileName=my-profile" \
-H "Authorization: Bearer $DRIVER_API_KEY"