Skip to main content
Show the Typewise full-page chat in your native iOS or Android app. Your app loads a small HTML page in a WebView, and that page loads the chat from Typewise.
Building with React Native or Expo, or want native chat components instead of a WebView? Use the Chat SDK.

Prerequisites

  • Your client ID. Find it under Behavior → Channels → Chat → Installation, in the Quick start snippet.
  • Every variable you pass is declared in Context Variables.

The chat page

The WebView loads this HTML. It sets window.twConfig and loads the full-page chat script:
string
required
Your Typewise chat client ID.
object
Context about the signed-in user, such as user_email. These values are unverified.
string
A JWT from your backend, for values that must pass the Trusted only check. See Identity verification.
Build this HTML in your app so each user gets their own clientId and variables. Serialize the configuration as JSON instead of pasting values into the script, so a quote or </script> in a value can’t break the page or inject code. Load it with https://platform.typewise.app/ as the base URL, so the script and its resources resolve correctly.

Load it in a WebView

1

Add a WKWebView

Present a full-screen WKWebView from a view controller or SwiftUI view, constrained to the safe area or the full screen.
2

Build the HTML

3

Load the HTML with the Typewise base URL

WKWebView runs JavaScript by default. If you pass a custom WKWebViewConfiguration, don’t disable it.

Domain allowlist

While your chat’s Domain allowlist is empty, the chat loads from any origin, including a WebView. If you’ve added domains, the WebView must load from an allowed origin. Loading the HTML with the base URL https://platform.typewise.app/ covers this. If you use a different base URL, add that origin under Behavior → Channels → Chat → Installation, or contact support to allow your app.

Troubleshooting

Check that JavaScript is enabled (and DOM storage on Android), and that the base URL is https://platform.typewise.app/. If your app applies a Content Security Policy, allow the domains in Configure CSP.
The WebView’s origin isn’t in your Domain allowlist. See Domain allowlist.
For other issues, see Chat widget troubleshooting.