Profiles
A profile is a saved Playwright storageState — cookies and localStorage. Log in once, attach the profile to every session, and start authenticated.
Create a profile
const profile = await client.profiles.create({ name: "amazon-seller" })
console.log(profile.id) // "prof_abc123"Headful editor
Open the profile in the console → Profiles → Open editor to drive a live browser through your tab. Log into your targets, click and solve any prompts, hit Save. Use this for sites with 2FA or human captchas.
Programmatic upload
Already have a working storageState.json? Push it directly:
import { readFile } from "node:fs/promises"
const storageState = JSON.parse(await readFile("./storage-state.json", "utf-8"))
await client.profiles.save(profile.id, storageState)Attach to a session
const session = await client.sessions.create({
profileId: "prof_abc123",
})
console.log(session.storageState?.cookies?.length, "cookies hydrated")List and delete
const profiles = await client.profiles.list()
for (const p of profiles) console.log(p.id, p.name)
await client.profiles.delete("prof_abc123")Treat profiles like credentials
Anyone with access to your API key can attach the profile to a session and act as the underlying account. Keep keys safe and scope them per-environment.
Storage shape
Profiles use Playwright's standard storageState — the same JSON context.storageState({ path }) writes.
type StorageState = {
cookies?: Array<{
name: string
value: string
domain?: string
path?: string
expires?: number
httpOnly?: boolean
secure?: boolean
sameSite?: "Strict" | "Lax" | "None"
}>
origins?: Array<{
origin: string
localStorage?: Array<{ name: string; value: string }>
}>
}