Use the device code flow for TVs, set-top boxes, IoT devices, or any app where you want second-screen sign-in. User sees a short code and QR code on the device. They scan the QR or enter the code on their phone or web browser. SDK polls in the background until authenticated.Documentation Index
Fetch the complete documentation index at: https://docs.discovr.media/llms.txt
Use this file to discover all available pages before exploring further.
Getting started
Request device code
Call
signInWithDeviceCode(). Returns
user code (e.g., “B7K-29F”) and QR code.Display to user
Show the user code and render the QR code on device. Tell user: “Sign in on your phone using
this code or QR.”
Wait for sign-in
SDK polls automatically. Listen with
onAuthStateChanged() (TypeScript) or
authState / authStateStream (Kotlin/Swift) for completion.Sign-in confirmed
Once user authorizes on their other device, SDK receives refresh token and notifies you.
Select profile & call API
Call
selectProfile(), then use DiscovrClient
methods as normal.Code example
How it works

- Device calls
signInWithDeviceCode() - Discovr returns user code (e.g., “B7K-29F”) and QR code
- Device displays code and QR to user
- User scans QR with phone or goes to
discovr.example.com/activateand enters code - User signs in on their phone
- SDK on device detects sign-in (automatic polling)
- Refresh token is stored locally on device
SDK handles polling automatically in background. Just listen for auth state changes.
Handling sign-in errors
Advanced: Manual HTTP implementation
If building a custom client without the SDK:Related SDK reference
signInWithDeviceCode · onAuthStateChanged · selectProfileNext: Understand sessions and profiles
