SDK/ createClient
createClient
Construct the SDK with the API key returned from onboarding plus a network preset. The SDK exchanges the key for a JWT, caches the token, and refreshes once on 401.
ts
import { createClient } from '@0xsend/cws/client'
const sdk = createClient({
apiKey: process.env.API_KEY!, // sk_mainnet_… / sk_testnet_…
network: 'mainnet', // 'mainnet' | 'testnet'
})