Determines if the current environment is a Mini App context by analyzing both environment characteristics and communication capabilities.Documentation Index
Fetch the complete documentation index at: https://docs.neynar.com/llms.txt
Use this file to discover all available pages before exploring further.
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.