from browser_use_sdk.v3 import AsyncBrowserUse
client = AsyncBrowserUse()
profile = await client.profiles.create(name="user-id-1")
# or search existing
# profile = (await client.profiles.list(query="user-id-1")).items[0]
session = await client.sessions.create(profile_id=profile.id)
result = await client.run("Check browser-use github stars", session_id=session.id)
print(result.output)
import { BrowserUse } from "browser-use-sdk/v3";
const client = new BrowserUse();
const profile = await client.profiles.create({ name: "user-id-1" });
// or search existing
// const profile = (await client.profiles.list({ query: "user-id-1" })).items[0];
const session = await client.sessions.create({ profileId: profile.id });
const result = await client.run("Check browser-use github stars", {
sessionId: session.id,
});
console.log(result.output);
Manage profiles
# Create
profile = await client.profiles.create(name="work-account")
# List all
response = await client.profiles.list()
for p in response.items:
print(p.id, p.name)
# Search by name
response = await client.profiles.list(query="user-id-1")
profile = response.items[0] # first match
# Get one by ID
profile = await client.profiles.get(profile_id)
# Update
await client.profiles.update(profile_id, name="renamed")
# Delete
await client.profiles.delete(profile_id)
// Create
const profile = await client.profiles.create({ name: "work-account" });
// List all
const response = await client.profiles.list();
for (const p of response.items) {
console.log(p.id, p.name);
}
// Search by name
const results = await client.profiles.list({ query: "user-id-1" });
const found = results.items[0]; // first match
// Get one by ID
const fetched = await client.profiles.get(profileId);
// Update
await client.profiles.update(profileId, { name: "renamed" });
// Delete
await client.profiles.delete(profileId);
Usage patterns
- Per-user profiles: Create one profile per end-user. Query by name to get the profile ID, or store a mapping between your users and their profile IDs in your database.
Profile state is only saved when the session ends. Always call
sessions.stop() when you are done — if a session is left open or times out, changes may not be persisted.