1. Wrap your app
-
walletshould be the currently connected wallet address (orundefinedwhen logged out). -
You can prove wallet ownership either via:
providerAdapter(recommended for Privy / Dynamic / custom JWT providers), or- a
proofprop you build yourself (SIWE, EIP-191, Ed25519, or provider_jwt).
-
Once the user is logged in and a proof is available, the SDK will handle
/auth/register,/auth/refresh, and/api/sessionunder the hood.
Learn more about configuring a provider here.
2. Login + gate example (pseudocode)
This is an illustrative high‑level flow. The key idea:Once the user logs in and the SDK has a proof + wallet, you do NOT need to callsession()yourself. Sunbreak automatically performs registration + refresh + session evaluation in the background. The valueallowedwill simply populate itself.