Skip to main content

Crefy Connect API Reference

Crefy Connect provides a comprehensive set of React components and hooks for building wallet-enabled applications. Our APIs are designed to be type-safe, chain-agnostic, and developer-friendly.

Available APIs

CrefyConnectProvider

Root provider component for configuring Crefy Connect in your app.

AuthModal

Pre-built authentication modal component with multiple login methods.

useCrefy Hook

Access authentication state, user details, and wallet information.

useSendEth Hook

Send native ETH transactions on supported chains.

SDK Overview

Crefy Connect provides React components and hooks for seamless integration:
// Provider setup
import { CrefyConnectProvider } from "crefy-connect";

<CrefyConnectProvider
  appId="<YOUR_CREFY_ID>"
  chain="sepolia"
  loginMethods={["google", "wallet", "email"]}
>
  <App />
</CrefyConnectProvider>

// Using hooks
import { useCrefy, useSendEth } from "crefy-connect";

const { user, walletInfo, isAuthenticated } = useCrefy();
const { sendEth, loading } = useSendEth();

TypeScript Support

All APIs are fully typed with TypeScript. Available types include:
  • CrefyConnectProviderProps - Provider configuration
  • CrefyUser - Authenticated user information
  • WalletInfo - Wallet address and chain details
  • SendEthParams - Transaction parameters
  • And many more…
Type Safety: Crefy Connect is designed with TypeScript first, ensuring type safety across all operations.

Error Handling

All hooks and components handle errors gracefully:
const { sendEth, error } = useSendEth();

try {
  await sendEth({
    to: "0x...",
    value: "0.1",
    chain: "sepolia"
  });
} catch (err) {
  console.error("Transaction failed:", error);
}