Dashboard

Browser Profiles

Browser profiles persist cookies, localStorage, and fingerprint data across sessions. This lets you maintain login states and avoid re-authenticating on every run.

How Profiles Work

  1. Create a profile via the API or SDK
  2. Pass the profileId when creating a browser session
  3. Set profilePersist: true to save changes when the session ends
  4. On the next session with the same profile, all data is restored

Creating a Profile

import { ScrayleClient } from '@scrayle/sdk';

const client = new ScrayleClient();

const profile = await client.profiles.create('my-login-profile');
console.log(profile.profileId); // Use this ID in browser sessions

Using a Profile

import { Playwright } from '@scrayle/sdk';
import { chromium } from 'playwright-core';

const { browserWSEndpoint } = await Playwright.connect({
  profileId: 'prof_abc123',
  profilePersist: true, // Save profile when session ends
});

const browser = await chromium.connectOverCDP(browserWSEndpoint);
const page = await browser.newPage();
await page.goto('https://example.com/dashboard');
// If previously logged in, the session is restored
await browser.close(); // Profile saved

Listing Profiles

const result = await client.profiles.list({
  page: 1,
  limit: 20,
  name: 'my-', // Optional name filter
});

for (const profile of result.docs) {
  console.log(profile.profileId, profile.name, profile.createdAt);
}

Deleting a Profile

await client.profiles.delete('prof_abc123');

Profile Data

Profiles store:

API Reference

MethodDescription
profiles.create(name)Create a new profile
profiles.get(profileId)Get profile details
profiles.list(params?)List all profiles (paginated)
profiles.delete(profileId)Delete a profile