A list of domains that are allowed to be accessed during the web flow.
If the user tries to navigate to a domain that is not in this list, the navigation will be stopped.
If this list is empty, no domain will be allowed.
Example:
allowedDomains: ["domain1.com", "domain2.tech"]
allowedDomains: ["*"] // allows all domains. Use with caution.
Optional stopA substring matched against each URL the web flow navigates to. When a URL contains this
value, the flow finishes successfully and start() resolves. An empty string matches the
first navigation, so omit the property instead of passing one.
Matching is a plain substring test, not a regular expression — regex metacharacters are treated literally.
Optional. When omitted, the flow does not end on navigation: it ends when the user closes
it, when the page calls window.close(), or when maxNavigationLimit is reached.
Omit it for flows driven by eventCallback or closed manually, rather than passing a
sentinel value that never matches.
- API LEVEL
23- Functionality added- API LEVEL
38- Becomes optional
Optional maxThe maximum number of navigations allowed before stopping the web flow.
If the navigation count reaches this limit, the web flow will be stopped.
Default value: 10
Optional onA js script to be executed when the startUrl completes loading.
Optional keepShows a loading screen until the browser navigates away from the initial domain. This is useful to prevent the user from interacting with the app while the web flow is loading.
Use cases: Login with Google, Login with Facebook, etc.
The loading screen will remain visible until the user is redirected to a different domain, typically triggered by onLoadJsScript.
Default value: false
Optional userOverrides the default User-Agent string sent by the web view.
Useful when the target website requires a specific browser identity or when the default desktop UA causes undesired behaviour (e.g., triggering bot-detection, forcing a desktop layout, or failing OAuth provider checks).
When omitted, the web view uses its built-in default User-Agent.
Example:
userAgent: "Mozilla/5.0 (Linux; Android 10; Mobile) AppleWebKit/537.36"
Optional cookiesCookies to inject into the WebView before the first navigation.
Each cookie requires a name and value. The domain and path are optional
and default to the host derived from startUrl and "/" respectively.
All cookies use a default expiration of 48 hours.
Example:
cookies: [
{ name: "session_id", value: "abc123" },
{ name: "auth_token", value: "xyz789", domain: ".example.com", path: "/api" }
]
Optional headerWhen provided, the web flow interface will display a header with the specified style.
Optional showWhether the web flow shows a close button.
Defaults to true. When false, neither the floating close button nor the header close
button is rendered.
Make sure the flow still has a way to finish before hiding it: a stopPattern, a
maxNavigationLimit, or a page that calls window.close(). Without any of them the
user has no way to leave the flow.
- API LEVEL
38- Functionality added
Optional bridgeInstalls a JavaScript bridge with this exact name inside the web flow, allowing the page to send messages back to your eitri-app while the flow is running.
The page sends messages calling:
window.<bridgeName>.postMessage("any string")
Every message is delivered to eventCallback.
Must be a valid JavaScript identifier of up to 64 characters: only letters, digits, _
and $, not starting with a digit.
Must be provided together with eventCallback.
- API LEVEL
38- Functionality added
Optional eventInvoked for every message the page sends on the bridge named by bridgeName.
data is always a string and is never parsed. When the page sends a JSON string, data
is that string, so parse it yourself.
The page should send a string. If it sends an object, the object is serialized to its JSON text so both platforms deliver the same value.
⚠️ The web flow renders a page you do not control, so treat data as untrusted input:
validate it before use, and never use it as an authenticated value without verifying it
on your backend.
Unsubscribed automatically when the web flow finishes.
Must be provided together with bridgeName.
- API LEVEL
38- Functionality added
Generated using TypeDoc
The URL to start navigation.