Documentation Index
Fetch the complete documentation index at: https://mintlify.com/faraasaaay/inner/llms.txt
Use this file to discover all available pages before exploring further.
YouTube is a Kotlin object (singleton) that serves as the primary API surface for the Inner library on Android. It wraps an internal InnerTube instance and exposes all configuration properties and suspend functions. Because it is a singleton, all properties you set are applied globally and persist for the lifetime of the process.
Configuration properties
Every writable property delegates internally to aPlaybackAuthState or to the underlying InnerTube instance. Setting authState is the most efficient way to update multiple fields at once; individual property setters are convenience wrappers that call authState = authState.copy(...) internally.
Get or set the full authentication state atomically. When set, the value is first normalized (whitespace stripped, invalid values cleared) and then propagated to the internal
InnerTube instance and to authStateFlow. Prefer setting this over individual properties when updating multiple fields simultaneously.Raw YouTube Music session cookie string (e.g.
"SAPISID=xxx; __Secure-3PSID=xxx; ..."). When non-null and contains a SAPISID key, hasLoginCookie() returns true and authenticated requests become available.The
X-Goog-Visitor-Id header value. You can obtain a fresh token by calling the visitorData() suspend function. Used as the sessionId when no login cookie is present.Sent as
onBehalfOfUser in the InnerTube request context for authenticated clients. When both cookie and dataSyncId are set, hasPlaybackLoginContext() returns true. Values containing || are automatically normalized.Generic PoToken fallback. Used when a more specific token (
poTokenPlayer or poTokenGvs) is not available and webClientPoTokenEnabled is true.PoToken that is appended to GVS stream URLs as the
pot= query parameter. Takes precedence over the generic poToken for GVS resolution. Only applied when webClientPoTokenEnabled is true and the client requires service integrity (web-family clients).PoToken sent in player requests. Takes precedence over the generic
poToken for player resolution. Only applied when webClientPoTokenEnabled is true and the client requires service integrity.Master switch that controls whether PoToken values are attached to web-family client requests (
WEB, WEB_REMIX, WEB_CREATOR, MWEB, WEB_EMBEDDED_PLAYER, TVHTML5, and related). Defaults to false. Set to true when you have valid PoToken values and want them included.An
java.net.Proxy instance applied to all HTTP requests made by the internal Ktor client. Supports both Proxy.Type.HTTP and Proxy.Type.SOCKS. Set to null to disable proxy usage.When
true, stream URL fetches bypass the configured proxy (i.e. streamProxy returns null). Useful when your proxy does not handle large media streams well. Defaults to false.Read-only computed property. Returns
null when streamBypassProxy is true, otherwise returns the value of proxy. Use this when resolving stream URLs to respect the bypass setting automatically.Controls the
gl (country code) and hl (language tag) fields sent in every InnerTube request context. Affects the language and regional availability of results. Example: YouTubeLocale(gl = "US", hl = "en-US").When
true, the session cookie is attached to browse requests (home, library, playlist, etc.). Enables personalised content. Defaults to false.Auth state flow
authStateFlow is a StateFlow<PlaybackAuthState> that emits the current auth state and every subsequent change. Collect it from a coroutine to react to login or token updates in real time.
authStateFlow is a cold-read StateFlow — subscribing immediately delivers the current value, so there is no race condition between reading the initial state and observing future updates.Helper methods
Returns
true if the current cookie string contains a SAPISID key. This is a synchronous check that does not make any network requests.Returns
true when both hasLoginCookie() is true and dataSyncId is non-null and non-blank. Required for requests that use onBehalfOfUser.Returns a snapshot of the current
PlaybackAuthState. Equivalent to reading authState. Useful when you need to capture state for an async operation without holding a reference to the mutable singleton.