Get OAuth credentials
You need values from Passage before you write code:client_id- public identifier for your appredirect_uri- exact callback URL registered with Passage (must match what you pass in the SDK)client_secret- server-only; never expose this to the browser or commit it to frontend bundles
COINLIST_CLIENT_SECRET), and use NEXT_PUBLIC_ only for values that are safe in the client (typically client_id and redirect_uri).
Install the SDK
react and react-dom >= 18.
See Package overview for all import paths (@coinlist-co/react, client/components, server, …).
SDK shape: client, server, and layers
Browser vs server
- Browser (React) -
CoinListClientruns in the client bundle. It starts and completes the OAuth redirect flow (PKCE + state insessionStorage), calls yourgetAccessTokento hydrate the session, and exposes methods such asfetchOffersandfetchOfferDetails. - Server -
CoinListServerruns in route handlers. It exchanges the authorization code for tokens, persists the session (you provide storage), refreshes access tokens, and serves a current access token to the client.
client_secret and refresh tokens.
Abstraction levels (prefer the top)
- Highest - React components (from
@coinlist-co/react) - UI and behavior together (for exampleCoinListSignInCard,OffersGrid). Use these first for the fastest integration. - Mid - React hooks (from
@coinlist-co/react) - Stateful behavior you mount in your own layout (useCompleteOAuth,useOffers,useOfferDetails,useParticipations,useRequirements). - Low - TypeScript clients (
CoinListClient,CoinListServer) - Imperative APIs with no React. Use for custom UX, non-React apps, or thin wrappers.
Next step
Set up OAuth authentication
Add
CoinListProvider, a sign-in surface, callback handling, and server routes.OffersGrid (or hooks / fetchOffers if you customize), then Display offer details for a single offer. For funding, participation tracking, and errors, see Recipes. Use the API reference when you need raw request and response details.