Skip to content

GlyphWalletProvider

The GlyphWalletProvider component is a React provider that wraps the WagmiProvider and QueryClientProvider, providing the GlyphWallet context to your application. This allows you to use Glyph Wallet functionality throughout your application. Learn more on the Native Integration guide.

Internal Structure

The GlyphWalletProvider component is a wrapper around several providers that work together to provide the Glyph Wallet context:

WagmiProvider
└── QueryClientProvider
    └── GlyphProvider
        └── Your Components

Import

tsx
import { GlyphWalletProvider } from "@use-glyph/sdk-react";

Usage

tsx
import { GlyphWalletProvider } from "@use-glyph/sdk-react";
import { QueryClient } from "@tanstack/react-query";
import { apeChain, Chain } from "viem/chains";

const supportedChains: [Chain, ...Chain[]] = [apeChain]; // Add more chains if needed

function App() {
	return (
		<GlyphWalletProvider chains={supportedChains}>
			{/* Your application components */}
		</GlyphWalletProvider>
	);
}

export default App;

Props

chains [Chain, ...Chain[]] required

The chains to use in your application. Must include at least one chain.

transports Record<number, Transport>

Optional transports to use for each chain. If not provided, defaults to standard HTTP transport for each chain.

queryClient QueryClient

Optional query client to use. If not provided, defaults to a standard query client.

ssr boolean

Whether to use server-side rendering. Use this if you're using Next.js or other frameworks that require server-side rendering.

children React.ReactNode required

The child components that will have access to the Glyph Wallet context.

askForSignature boolean

Optional. Whether to ask for a signature from the user after connecting. Set to false if you DO NOT intend to use the Glyph Widget or need the useGlyph hook's context to be authenticated. Defaults to true.

onLogin () => void

Optional. A callback function that is called when the user logs in.

onLogout () => void

Optional. A callback function that is called when the user logs out.