Skip to content

Hooks

The Glyph Widget library provides several hooks to access user data, manage balances, and interact with the widget functionality. All hooks must be used within a GlyphProvider.

Available Hooks

tsx
import {
	useGlyph,
	useBalances,
	useGlyphFunding,
	useActivity,
	useGlyphConfigureDynamicChains,
	useNativeGlyphConnection,
} from "@use-glyph/sdk-react";

Core Hooks

Balance Hooks

Funding Hooks

Activity Hooks

  • useActivity - Fetch and manage transaction activity with optional type filtering

Provider Requirement

All hooks must be used within a GlyphProvider. Using them outside will throw an error.

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

function App() {
	return (
		<GlyphProvider>
			{/* Components using hooks can be used here */}
			<YourComponent />
		</GlyphProvider>
	);
}

Next Steps

  • Explore each hook's documentation for detailed usage information, parameters, and return types.