Install
Shared Client
Create a reusable client module so both your API routes and any server components can share the same instance:API Route
The API route runs on the server and is the single place your application calls the BlackSwan SDK. It accepts awallet query parameter and returns the credit dashboard as JSON:
Client Component
The client component calls the API route from the browser and renders the result. Mark it with"use client" so Next.js keeps it out of the server bundle: