useCreateGuestWallets hook creates wallets for a guest (unauthenticated) session. Guest wallets can be claimed later when the user signs up.
Hook for creating wallets for unauthenticated guest users
useCreateGuestWallets hook creates wallets for a guest (unauthenticated) session. Guest wallets can be claimed later when the user signs up.
import { useCreateGuestWallets } from "@getpara/react-native-wallet";
import { useCreateGuestWallets } from "@getpara/react-native-wallet";
import { Button } from "react-native";
function GuestWalletButton() {
const { createGuestWalletsAsync, isPending } = useCreateGuestWallets();
const handleCreate = async () => {
try {
const wallets = await createGuestWalletsAsync();
console.log("Guest wallets:", wallets.map((w) => w.id));
} catch (err) {
console.error(err);
}
};
return <Button title={isPending ? "Creating..." : "Continue as Guest"} onPress={handleCreate} disabled={isPending} />;
}