Usage
Parameters
timeoutMs (optional)
- Type:
number - Default:
100
Return Value
- Type:
Promise<boolean>
true if running in a Mini App context, or false otherwise.
Details
The function uses a multi-step approach to detect Mini App environments:-
Fast Short-Circuit: Returns
falseimmediately in certain scenarios:- During server-side rendering
- When neither in an iframe nor in ReactNative WebView
- Context Verification: For potential Mini App environments (iframe or ReactNative WebView), verifies by checking for context communication.
- Result Caching: Once confirmed to be in a Mini App, the result is cached for faster subsequent calls.

