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 ComponentsImport
import { GlyphWalletProvider } from "@use-glyph/sdk-react";Usage
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
[Chain, ...Chain[]] requiredThe chains to use in your application. Must include at least one chain.
Record<number, Transport>Optional transports to use for each chain. If not provided, defaults to standard HTTP transport for each chain.
QueryClientOptional query client to use. If not provided, defaults to a standard query client.
booleanWhether to use server-side rendering. Use this if you're using Next.js or other frameworks that require server-side rendering.
React.ReactNode requiredThe child components that will have access to the Glyph Wallet context.
booleanOptional. 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.
() => voidOptional. A callback function that is called when the user logs in.
() => voidOptional. A callback function that is called when the user logs out.
