Skip to main content
The SW Combine SDK is a TypeScript library for interacting with the Star Wars Combine API v2.0. It covers all 60+ endpoints across 11 resource categories — characters, factions, the galaxy, inventory, market, news, events, types, location, datacards, and API utilities — and handles OAuth 2.0 authentication, automatic token refresh, pagination, and retries so you can focus on building your application.

Key features

TypeScript first

Full type definitions for every endpoint, parameter, and response. Your editor autocompletes method names, parameters, and return types without any extra configuration.

OAuth 2.0 built in

Complete OAuth flow with authorization URL generation, callback handling, and automatic token refresh. Supports both online and offline access types.

Auto-pagination

Every list endpoint returns Page<T> with hasMore, getNextPage(), and for await...of support to iterate across all results automatically.

Automatic retries

Exponential backoff for network errors, 5xx responses, and rate limit hits. Respects Retry-After headers from the API.

Type-safe OAuth scopes

170+ scope constants with autocomplete — CharacterScopes.READ, MessageScopes.SEND, Scopes.PersonalInventory.SHIPS.READ — so you never mistype a scope string.

Minimal footprint

A single production dependency (axios). Ships as both ES Modules and CommonJS so it works with any Node.js project setup.

Supported resources

The client exposes all 11 resource categories through a single SWCombine instance:
PropertyResourceWhat it covers
client.characterCharactersProfile, messages, skills, privileges, credits, credit log
client.factionFactionsInfo, members, budgets, stockholders, credits, credit log
client.galaxyGalaxySystems, sectors, planets, stations, cities
client.inventoryInventoryEntity listing and management across all entity types
client.marketMarketVendor listings and details
client.newsNewsGalactic News Service (GNS) and Sim News feeds
client.eventsEventsPersonal, faction, inventory, and combat events
client.typesTypesEntity types, classes, and detailed type info
client.locationLocationEntity location lookups
client.datacardDatacardsDatacard management and assignment
client.apiAPI utilitiesHello world, permissions, rate limits, time conversion
The SDK also exports a Timestamp utility for working with Combine Galactic Time (CGT), which uses the Star Wars Combine’s custom calendar system.

Requirements

  • Node.js 18 or higher
  • TypeScript 5.5 or higher (for TypeScript projects)
  • An npm account to install the package

Get started

Quickstart

Install the SDK, initialize a client, and make your first API call in under five minutes.

Installation

Detailed setup instructions including environment variables, ESM vs CJS configuration, and TypeScript setup.

Authentication

Set up OAuth 2.0, obtain access tokens, and configure automatic token refresh.

API resources

Browse all available resource methods with parameters and examples.