Login Helper

Automate logging into a website using stored credentials. This creates a login workflow, executes it, and optionally waits for completion.

Python Example

from skyvern.schemas.run_blocks import CredentialType

result = await client.login(
    credential_type=CredentialType.skyvern,
    credential_id="cred_abc123",
    url="https://app.example.com/login",
    wait_for_completion=True,
)
print(result.status)

TypeScript Example

const result = await client.login({
    credentialType: CredentialType.skyvern,
    credentialId: "cred_abc123",
    url: "https://app.example.com/login",
    waitForCompletion: true,
});
console.log(result.status);

Parameters

Parameter Type Required Default Description
credential_type CredentialType Yes - How credentials are stored. Options: skyvern, bitwarden, onepassword ("1password" in TS), azure_vault.
url str No None The login page URL.
credential_id str No None The Skyvern credential ID (when using skyvern type).
prompt str No None Additional instructions for the AI during login.
browser_session_id str No None Run login inside an existing browser session.
browser_address str No None Connect to a browser at this CDP address.
proxy_location ProxyLocation No None Route browser traffic through a geographic proxy.
webhook_url str No None URL to receive a POST when the login finishes.
totp_identifier str No None Identifier for TOTP verification.
totp_url str No None URL to receive TOTP codes.
wait_for_completion (Python) / waitForCompletion (TS) bool No False Block until the login finishes.
timeout float No 1800 Max wait time in seconds.
extra_http_headers dict[str, str] No None Additional HTTP headers.
max_screenshot_scrolling_times int No None Number of screenshot scrolls.
browser_profile_id str No None Load a browser profile into the session.
request_options RequestOptions No None Per-request configuration (see below).

Returns WorkflowRunResponse

Example: Login then extract data

Python

from skyvern.schemas.run_blocks import CredentialType

session = await client.create_browser_session()

# Login
await client.login(
    credential_type=CredentialType.skyvern,
    credential_id="cred_abc123",
    url="https://app.example.com/login",
    browser_session_id=session.browser_session_id,
    wait_for_completion=True,
)

# Now extract data from the authenticated session
result = await client.run_task(
    prompt="Go to the billing page and extract all invoices",
    browser_session_id=session.browser_session_id,
    wait_for_completion=True,
)
print(result.output)

Request Options

Override timeout, retries, or headers for this call by passing request_options (Python) or a second options argument (TypeScript).

Python

from skyvern.client.core import RequestOptions

request_options=RequestOptions(
    timeout_in_seconds=120,
    max_retries=3,
    additional_headers={"x-custom-header": "value"},
)
Option (Python) Option (TypeScript) Type Description
timeout_in_seconds timeoutInSeconds int / number HTTP timeout in seconds.
max_retries maxRetries int / number Retry count.
additional_headers headers dict / Record<string, string> Extra headers.
additional_query_parameters - dict Extra query parameters.
additional_body_parameters - dict Extra body parameters.
- abortSignal AbortSignal Signal to cancel the request.
- apiKey string Override API key.