TrueID integration

Everything a TrueID app needs to open the TrueVisions NOW mini-app signed in: which token to send, how to open any page with it, and what the viewer sees. Every page requires a signed-in viewer; there is no guest mode.

At a glance

TrueID
Partner slugtrueid
Base URLhttps://mini-app.truevisions.co.th/[th|en]/trueid
CredentialAuthorization: Bearer <BRIDGED_TID_TOKEN> (HTTP header)
Sign-in pathBridged: the TID token is already a TrueVisions token, so there is no AAA round trip.
How to open a pageGET the page URL with the token headers (a POST works too).

Step by step

  1. Set up the WebView. JavaScript, DOM storage, inline media playback, autoplay without a gesture and protected media. See Install in your app and DRM in WebViews.
  2. Pick the page the viewer should land on from Pages you can open, in th or en, and add ?embed=1.
  3. Open it with the token. Load that URL with the Authorization: Bearer <BRIDGED_TID_TOKEN> header. Copy-paste code is in Examples.
  4. Let the redirects run. The server hands the bridged token straight to the page with a 303 back to the same URL, signed in.
  5. Listen to the bridge. ready, auth-state, open-content, close, orientation, subscribe, sign-in. See postMessage bridge.
  6. Re-sign-in when asked. On sign-in (the stream lookup rejected the token), open the message's returnUrl the same way as step 3 with a fresh token. Sessions last about an hour; after that any page asks again.
  7. Test on pre-production with your own test accounts before going live (see Testing).

Pages you can open

All of these accept the token the same way. mOdBP4KN5vd3 is a real series title on pre-production; use any content id from the feeds.

PageURLWhat it shows
Partner home/th/trueid?embed=1Landing page with the partner's shelves.
Sport/th/trueid/sport?embed=1All live and upcoming sport, grouped by day.
Series/th/trueid/series?embed=1All series and movies in the free catalogue.
The Voice 2026/th/trueid/thevoice?embed=1The Voice shelf page.
Content detail/th/trueid/content/mOdBP4KN5vd3?embed=1One title: synopsis, episodes, Watch Now.
Player/th/trueid/play/mOdBP4KN5vd3?embed=1Full-screen player; a series starts at episode 1.
Player, one episode/th/trueid/play/mOdBP4KN5vd3?ep=<EPISODE_ID>&embed=1Jump to a specific episode.
Live channel/th/trueid/watch/<CHANNEL_ID>?embed=1Live TV player for one channel.

Examples

Raw requests for the four most common pages. The response is a redirect chain; let the WebView follow it.

All seriesHTTP
GET https://mini-app.truevisions.co.th/th/trueid/series?embed=1
Authorization: Bearer <BRIDGED_TID_TOKEN>
Sport scheduleHTTP
GET https://mini-app.truevisions.co.th/th/trueid/sport?embed=1
Authorization: Bearer <BRIDGED_TID_TOKEN>
Content detail pageHTTP
GET https://mini-app.truevisions.co.th/th/trueid/content/mOdBP4KN5vd3?embed=1
Authorization: Bearer <BRIDGED_TID_TOKEN>
Straight into the playerHTTP
GET https://mini-app.truevisions.co.th/th/trueid/play/mOdBP4KN5vd3?embed=1
Authorization: Bearer <BRIDGED_TID_TOKEN>
Android (Kotlin)Kotlin
// Opens any mini-app page signed in: GET the page with your token headers.
// loadUrl sends the extra headers on the first request only, which is all
// sign-in needs; the page keeps the session after that.
fun openMiniApp(webView: WebView, path: String, token: String) {
    webView.loadUrl(
        "https://mini-app.truevisions.co.th/th/trueid" + path,
        mapOf(
            "Authorization" to "Bearer $token"
        )
    )
}

openMiniApp(webView, "/sport?embed=1", token)
openMiniApp(webView, "/series?embed=1", token)
openMiniApp(webView, "/content/mOdBP4KN5vd3?embed=1", token)
openMiniApp(webView, "/play/mOdBP4KN5vd3?embed=1", token)
iOS (Swift)Swift
// Opens any mini-app page signed in: GET the page with your token headers.
func openMiniApp(_ webView: WKWebView, path: String, token: String) {
    var request = URLRequest(url: URL(string: "https://mini-app.truevisions.co.th/th/trueid" + path)!)
    request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
    webView.load(request)
}

openMiniApp(webView, path: "/sport?embed=1", token: token)
openMiniApp(webView, path: "/series?embed=1", token: token)
openMiniApp(webView, path: "/content/mOdBP4KN5vd3?embed=1", token: token)
openMiniApp(webView, path: "/play/mOdBP4KN5vd3?embed=1", token: token)

If a page is opened without a token

The page sends the viewer to the TrueID login page (identity.trueid.net) and brings them back to the same page once they log in. That works, but it makes the viewer log in again inside your app, so always open pages with the token.

When sign-in fails

The WebView lands on /th/trueid/auth/error?code=…, a localised page with a Back to home button.

CodeMeaningWhat to do
missing_credentialsNo token found in the request.Check the header name: Authorization.
invalid_stateThe sign-in link expired (10 minutes) or was tampered with.Open the page again.

Testing

  • Pre-production base URL: https://mini-app.truevisions.co.th. It talks to TrueID pre-production (identity.trueid-preprod.net).
  • Pre-production TrueID accounts can be real accounts: purchases may charge real money. Use the test accounts from onboarding.
  • In the WebView's network log the first request is your page URL with the token, then a 303 back to the same URL with #at=…, which the page removes from the address bar at once.