In-app WebViews are a hostile environment for OAuth — detect and degrade gracefully rather than fighting the platform.
A portfolio's default visitor is unauthenticated; auth should never stand between a visitor and the content.
Guarding every Clerk hook behind a safe wrapper keeps the tree from crashing when the provider is intentionally absent.
The problem
Most people who click a portfolio link are inside a social app — LinkedIn, Instagram, X. Those apps open links in an in-app WebView, not the system browser. Clerk's OAuth relies on popup and redirect flows that WebViews routinely block, so a visitor coming from social hit a broken sign-in wall before seeing a single project.
The call
Detect the embedded browser from the user-agent and never mount Clerk there. Real browsers get the full authenticated experience; WebView visitors get the entire public portfolio with the dashboard and sign-in simply not present. A useSafeClerk hook makes components that reference Clerk safe to render when the provider isn't there.
Why not just force auth
Because the default visitor to a portfolio is unauthenticated and always will be. Auth here gates exactly one thing — my own dashboard. Letting it break the experience for a large slice of real traffic to protect a page only I use is the wrong trade.