Profile

A Profile preserves browser configuration and state across sessions, primarily for maintaining login states and user-specific settings.

What is a Profile?

A persistent storage container that maintains:

  • Login state: Saved cookies and authentication tokens
  • Browser preferences: Language, timezone, viewport settings
  • User data: Form auto-fill information
  • Site-specific settings: Permissions, local storage

Key Properties

  • id: Unique profile identifier
  • createdAt: When the profile was created
  • lastUsedAt: When last used in a session

Automatically stores: Cookies, local storage, browser settings, form data

Managing Profiles

1import { BrowserUseClient } from "browser-use-sdk";
2
3const client = new BrowserUseClient({ apiKey: "bu_..." });
4
5// Create and manage profiles
6const profile = await client.profiles.createProfile();
7const profiles = await client.profiles.listProfiles();
8const details = await client.profiles.getProfile(profile.id);
9await client.profiles.deleteProfile(profile.id);

Usage Patterns

User-Specific Profiles

1// Create profile per user
2const userProfile = await client.profiles.createProfile();
3
4// Store profile ID in your application's user record
5const user = { id: "user_123", browserProfileId: userProfile.id };
6
7// Later, retrieve and use for automations
8const session = await client.sessions.createSession({ profileId: user.browserProfileId });
9const task = await client.tasks.createTask({
10 sessionId: session.id,
11 task: "Check my notifications"
12});
13
14const result = await task.complete();

Site-Specific Profiles

1// Create LinkedIn-specific profile
2const linkedinProfile = await client.profiles.createProfile();
3const session = await client.sessions.createSession({ profileId: linkedinProfile.id });
4
5// Initialize with login
6const loginTask = await client.tasks.createTask({
7 sessionId: session.id,
8 task: "Log into LinkedIn",
9 inputFiles: ["credentials.json"]
10});
11
12// Use for LinkedIn automations
13const networkTask = await client.tasks.createTask({
14 sessionId: session.id,
15 task: "Find and connect with AI professionals"
16});

Environment-Specific Profiles

1// Separate profiles for dev/prod
2const devProfile = await client.profiles.createProfile();
3const prodProfile = await client.profiles.createProfile();
4
5const profileId = process.env.NODE_ENV === 'production' ? prodProfile.id : devProfile.id;
6const session = await client.sessions.createSession({ profileId });

State Management

Automatic Persistence: State saves after each session

1// State is automatically saved
2const session = await client.sessions.createSession({ profileId: "profile_123" });
3const loginTask = await client.tasks.createTask({
4 sessionId: session.id,
5 task: "Log into admin dashboard"
6});
7
8// Later sessions inherit saved state
9const newSession = await client.sessions.createSession({ profileId: "profile_123" }); // Already logged in!

Complete Isolation: Each profile maintains separate state with no cross-contamination between users.

Profile Optimization

Warm-Up Profiles: Pre-login to common services for faster automation

1// Pre-configure profile with logins
2async function warmUpProfile(profileId: string) {
3 const session = await client.sessions.createSession({ profileId });
4
5 const loginTasks = ["Log into Gmail", "Log into Slack", "Log into admin dashboard"];
6 for (const task of loginTasks) {
7 const loginTask = await client.tasks.createTask({ sessionId: session.id, task });
8 await loginTask.complete();
9 }
10
11 await client.sessions.stopSession(session.id);
12}

Maintenance: Refresh profiles older than 7 days to keep login state fresh


Next Steps