Documentation Index
Fetch the complete documentation index at: https://libretto.sh/docs/llms.txt
Use this file to discover all available pages before exploring further.
Pass credentials into a workflow, and reuse authenticated browser state across runs when the login can’t be scripted.Most real automation targets sit behind a login. There are two patterns for getting past it, and they cover different kinds of login:
- Pass credentials into the workflow as input (username, password, TOTP secret). The workflow’s Playwright code fills them into the login form and submits, just like any other form interaction. This works for any login you can script end-to-end, including ones with TOTP.
- Save an authenticated profile from a one-time manual login and reuse it with
--auth-profile. Use this when the login can’t be scripted (CAPTCHAs, SMS codes, device-approval prompts, magic links), so future runs start already signed in.
Passing credentials into a workflow
Workflows receive a typedinput object. Credentials are just fields on that input, and your Playwright code fills them into the page the same way it fills any other form. If the site also requires a TOTP (Google Authenticator style) code, store the shared secret alongside the other credentials and derive a fresh code each run with a library like otplib:
Saving profiles locally
When a site’s login can’t be scripted (CAPTCHAs, SMS codes, device prompts, magic links), the workaround is to log in once in a visible browser and snapshot the authenticated state. Libretto calls that snapshot a profile: cookies,localStorage, and other persistent storage saved to .libretto/profiles/<domain>.json. Future runs start already signed in by loading the profile.
Open the site in headed mode
portal-login.Complete the login in the browser
Enter credentials, solve CAPTCHAs, approve device prompts, or whatever else the site requires.
Save the session as a profile
.libretto/profiles/portal.example.com.json.- Machine-local. They live in
.libretto/profiles/and are not shared across environments or team members. - Git-ignored by default. The
.libretto/.gitignorecreated during setup excludes them. - Effectively credentials. Treat them like a password. Never commit, never share, and rotate them if leaked.