Loading...
Loading...
Build a Next.js app that authenticates users, launches the Connector, and fetches financial data. Learn session token management and avoid rate limit errors.
Time: ~15 minutes Framework: Next.js (concepts apply to any framework)
A Next.js app that:
Session tokens authenticate users for the Connector and GraphQL API:
We'll use QuilttAuthProvider from @quiltt/react to handle token management automatically.
pnpm, yarn, or npm)This tutorial uses pnpm but commands work with any package manager.
Create a Next.js project and install dependencies:
Add your credentials from the Dashboard:
Never commit QUILTT_API_KEY_SECRET to Git. It's for server-side use only.
Start the dev server:
Create a server-side endpoint to issue tokens (this protects your API key from client-side exposure):
Fetch tokens and pass to QuilttAuthProvider. This handles session management, Connector auth, and GraphQL client setup.
Critical: This code checks localStorage before issuing new tokens. Without caching, every page refresh issues a new token, quickly hitting the 10/hour rate limit.
Only need the Connector (not GraphQL)? Use QuilttProvider instead of QuilttAuthProvider.
Wire up the Providers component:
Add a button that launches the Connector (automatically authenticated):
Visit http://localhost:3000 and click "Launch Connector":
Use useQuilttClient for GraphQL queries:
Add the Welcome component to your page:
Refresh the page to see the greeting:
Continue Learning:
Reference Documentation: