Install the package
Add The SDK requires Node.js 18+ and TypeScript 5.5+ for TypeScript projects. Its only production dependency is
swcombine-sdk to your project using your preferred package manager:axios.Initialize the client
The
SWCombine class supports three initialization modes depending on what you need:If you provide
clientId, you must also provide clientSecret — and vice versa. The SDK throws immediately if only one is set.Call a public endpoint
Some endpoints are available without authentication. The returned
character.getByHandle is a good first call — it resolves a character handle to a UID and requires no access token:uid uses the format "type:id" (for example, "1:12345" for a character). You’ll use this UID to fetch full profile details from authenticated endpoints.Make an authenticated request
Most endpoints require an access token. Initialize a client with a token and call You can also call
character.get to retrieve a full character profile:client.character.me() to fetch the profile of the character who owns the current access token — no UID needed:Paginate through results
Every
list() method returns a Page<T> object with pagination built in. You can check hasMore, call getNextPage() manually, or use for await...of to iterate across all pages automatically:Auto-pagination with
for await...of makes sequential API requests until all items are returned. Keep the rate limit of 600 requests per hour in mind when iterating large datasets.Next steps
Authentication
Set up OAuth 2.0 and get an access token for authenticated endpoints.
Installation
Full installation details including environment variables and import styles.
Pagination
Learn how
Page<T> works, how to control page size, and how auto-pagination behaves.Error handling
Catch typed
SWCError exceptions and handle retryable vs non-retryable failures.