Authenticate into target websites during hosted Libretto Cloud runs.
credentials declares which secrets the workflow can use for login.authProfile declares the provider-native browser profile to reuse.librettoAuthenticate checks whether the profile is signed in and runs sign-in if needed.1234567891011121314151617181920212223242526import { librettoAuthenticate, workflow } from "libretto"; export default workflow("portalReport", { startUrl: "https://portal.example.com", credentials: ["username", "password"], authProfile: { name: "portal", refresh: true, }, async handler(ctx, input) { await librettoAuthenticate(ctx, { credentials: input.credentials, isSignedIn: async ({ page }) => await page .getByRole("button", { name: /account|sign out/i }) .isVisible() .catch(() => false), signIn: async ({ page }, credentials) => { await page.goto("https://portal.example.com/login"); await page.getByLabel("Email").fill(credentials.username); await page.getByLabel("Password").fill(credentials.password); await page.getByRole("button", { name: /log in/i }).click(); }, }); }, });
LIBRETTO_CLOUD_ variables in .env:12LIBRETTO_CLOUD_USERNAME=alice@example.com LIBRETTO_CLOUD_PASSWORD=secret
LIBRETTO_CLOUD_ variables to Libretto Cloud:1npx libretto cloud credentials push
.libretto/profiles/<name>.json files, and Libretto does not upload local profile files during deploy.authProfile, Libretto Cloud registers the profile name if it does not already exist. When a hosted run starts, Libretto Cloud passes that profile name to the active browser provider.refresh: true is set, the hosted provider should persist browser state changes made during the run back to that profile. This lets a successful sign-in repair an expired profile for future runs..libretto/profiles/. They are useful for local runs and local development.--provider libretto-cloud.