Skip to main content
Glama
PassKeyButton.tsx1.2 kB
'use client'; import { Button } from '@intlayer/design-system'; import { useIsMounted, useSession, useSignInPasskey, } from '@intlayer/design-system/hooks'; import { Key } from 'lucide-react'; import { useIntlayer } from 'next-intlayer'; import type { FC } from 'react'; export const PasskeyButton: FC = () => { const { revalidateSession } = useSession(); const { mutate: signInPasskey, isPending } = useSignInPasskey(); const { text, ariaLabel } = useIntlayer('passkey-button'); // useEffect(() => { // // Check if the browser supports WebAuthn and Conditional UI // signInPasskey( // { autoFill: true }, // { // onSuccess: () => revalidateSession(), // onError: () => { // // No need to handle errors // }, // } // ); // }, []); const handleSignIn = () => { signInPasskey( { autoFill: false }, { onSuccess: () => revalidateSession(), } ); }; return ( <Button variant="outline" color="text" className="w-full" Icon={Key} label={ariaLabel.value} onClick={handleSignIn} isLoading={isPending} > {text} </Button> ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server