Skip to main content
Users log themselves in on their own devices, so your automation never handles their credentials. These methods wait for that to finish, then hand control back.

Methods

page.authenticate()

Navigates to a URL and waits for authentication to complete.
Parameters:
  • startURL: URL to navigate to for authentication
  • authEvaluator: Function that checks if authentication is complete
  • options (optional): Authentication options
AuthEvaluator:
Options:
Returns: Promise<AuthStatus> - Either 'authenticated' or 'aborted' Examples:

page.waitForAuthentication()

Waits for authentication to complete without navigating.
Parameters:
  • authEvaluator: Function that checks if authentication is complete
  • options (optional): Authentication options
Returns: Promise<AuthStatus> - Either 'authenticated' or 'aborted' Example:

Complete examples

OAuth flow

Social login

Two-factor authentication

Session-based authentication

Mobile app authentication

Best practices

With Uplink, users authenticate themselves on their own devices:
Authentication often requires user interaction, so use longer timeouts:
Verify authentication using multiple methods:
Always handle the aborted case:
Extract and store authentication tokens for later use:

Cookies

Manage authentication cookies

Waiting

Wait for authentication indicators

Navigation

Navigate to auth pages

Page overview

Back to Page API overview