This method should be called anytime a wallet is detected (on initial page load, wallet login, and wallet change):
spindl.attribute(walletAddress: string);
window.spindl.attribute(walletAddress: string);
In most frameworks, this is as simple as adding a single line in the lifecycle hooks.
Wagmi Tracking Wallet Connect
import spindl from"@spindl-xyz/attribution";// import spindl from "@spindl-xyz/attribution-lite" // only for lite version customersimport { useAccount } from"wagmi";// ...constComponent= () => {const { address } =useAccount();useEffect(() => {if (address) {spindl.attribute(address); } }, [address]);// ...};
ThirdWeb Tracking Wallet Connect
import spindl from"@spindl-xyz/attribution";// import spindl from "@spindl-xyz/attribution-lite" // only for lite version customersconstaddress=useAddress();React.useEffect(() => {if (address) {spindl.attribute(address); }}, [address]);