Content
@
https://warpcast.com/~/channel/frames
0 reply
4 recasts
4 reactions
NelsonRodMar.eth
@nelsonrodmar
I'm actually adapting a website to be FramesV2 aka MiniApps compatible. The project use this library https://github.com/duskload/react-device-detect to know if the website is open on a computer or a mobile and so adapt its design depending on what the answer is. To detect if it's a mobile or a computer, this library is based on the User-Agent header. So my question is what User-Agent is send in MiniApps ? Because it looks like it’s a User-Agent from a computer, and my website is visible like if it was on a computer. And could it be possible for the Farcaster team to change the User-Agent headers ? Taging some Farcaster dev ecosystem to get some visibility @linda @woj.eth @ted and also @samuellhuber.eth maybe you got and idea
1 reply
2 recasts
12 reactions
Samuel ツ
@samuellhuber.eth
you'd check frame sdk context being available or not to see if you're in a Farcaster Frame or not. const [context, setContext] = useState<FrameContext>(); useEffect(() => { const load = async () => { setContext(await sdk.context); sdk.actions.ready(); }; if (sdk && !isSDKLoaded) { setIsSDKLoaded(true); load(); } }, [isSDKLoaded]); then in your code check if context?.user exists or not.
1 reply
0 recast
2 reactions