Using scope constants
The SDK exports typed constants for every scope. Using them instead of raw strings gives you IDE autocomplete, compile-time typo detection, and a single source of truth if scope names ever change:All scope values sent to the API are lowercase strings with underscores (e.g.,
character_read, personal_inv_ships_all). The constants resolve to these lowercase literals automatically. The API rejects uppercase scope strings.Scope categories
Character scopes — CharacterScopes
Character scopes — CharacterScopes
Import:
import { CharacterScopes } from 'swcombine-sdk'| Constant | Value | What it grants |
|---|---|---|
CharacterScopes.AUTH | character_auth | Character name and ID only, for identity verification |
CharacterScopes.READ | character_read | UID, handle, image, race, gender (and more if profile is public) |
CharacterScopes.STATS | character_stats | HP and XP |
CharacterScopes.PRIVILEGES | character_privileges | Character privileges |
CharacterScopes.SKILLS | character_skills | Character skills |
CharacterScopes.CREDITS | character_credits | Credit balance (read-only) |
CharacterScopes.CREDITS_WRITE | character_credits_write | Transfer credits |
CharacterScopes.FORCE | character_force | Force points, FXP, regen rate, Force Meter |
CharacterScopes.LOCATION | character_location | In-game location |
CharacterScopes.EVENTS | character_events | Character event log |
CharacterScopes.ALL | character_all | All character permissions |
Message scopes — MessageScopes
Message scopes — MessageScopes
Import:
import { MessageScopes } from 'swcombine-sdk'| Constant | Value | What it grants |
|---|---|---|
MessageScopes.READ | messages_read | Read messages sent to or by the character |
MessageScopes.SEND | messages_send | Send messages |
MessageScopes.DELETE | messages_delete | Delete messages |
MessageScopes.ALL | messages_all | Read, send, and delete messages |
Personal inventory scopes — Scopes.PersonalInventory
Personal inventory scopes — Scopes.PersonalInventory
Import: The same actions (
import { Scopes } from 'swcombine-sdk'Personal inventory scopes follow the pattern Scopes.PersonalInventory.{ENTITY}.{ACTION}. The top-level overview scope gives access to inventory summary data.READ, RENAME, ASSIGN, MAKEOVER, TAGS_READ, TAGS_WRITE, ALL) are available for: VEHICLES, STATIONS, CITIES, FACILITIES, ITEMS, DROIDS, MATERIALS, CREATURES. Planets have a reduced set (READ, ASSIGN, TAGS_READ, TAGS_WRITE, ALL); NPCs don’t have RENAME.Faction scopes — FactionScopes
Faction scopes — FactionScopes
Import:
import { FactionScopes } from 'swcombine-sdk'| Constant | Value | What it grants |
|---|---|---|
FactionScopes.READ | faction_read | Basic faction information |
FactionScopes.MEMBERS | faction_members | Faction members list |
FactionScopes.STOCKS | faction_stocks | Stocks owned by the faction |
FactionScopes.CREDITS_READ | faction_credits_read | Faction credit balance |
FactionScopes.CREDITS_WRITE | faction_credits_write | Transfer faction credits |
FactionScopes.BUDGETS_READ | faction_budgets_read | Faction budget details |
FactionScopes.BUDGETS_WRITE | faction_budgets_write | Modify faction budgets |
FactionScopes.DATACARDS_READ | faction_datacards_read | Faction datacard assignments |
FactionScopes.DATACARDS_WRITE | faction_datacards_write | Assign or revoke datacards |
FactionScopes.ALL | faction_all | All faction permissions |
Faction inventory scopes — Scopes.FactionInventory
Faction inventory scopes — Scopes.FactionInventory
Import: The full set of entity types mirrors the personal inventory:
import { Scopes } from 'swcombine-sdk'Faction inventory scopes mirror the personal inventory structure under Scopes.FactionInventory:SHIPS, VEHICLES, STATIONS, CITIES, FACILITIES, PLANETS, ITEMS, NPCS, DROIDS, MATERIALS, CREATURES.Helper functions
The SDK provides four helper functions that return pre-built scope arrays for common scenarios:| Function | Returns | Use case |
|---|---|---|
getMinimalScopes() | ['character_auth', 'character_read'] | Login / identity verification only |
getReadOnlyScopes() | Character read, stats, skills, credits, messages read, inventory overview, faction read | Analytics dashboards and read-only integrations |
getAllCharacterScopes() | All CharacterScopes.* values | Character management tools |
getAllMessageScopes() | All MessageScopes.* values | Full messaging access |
getAllPersonalInventoryScopes() | All PersonalInventoryScopes.* values | Personal asset management |
getAllFactionScopes() | All FactionScopes.* values | Faction administration |
getAllFactionInventoryScopes() | All FactionInventoryScopes.* values | Faction asset management |
getAllScopes() | All 170+ scopes across every category | Development and testing only |
Common scope combinations
Login / authentication only
Login / authentication only
Character profile dashboard
Character profile dashboard
Messaging application
Messaging application
Fleet management tool
Fleet management tool
Faction administration tool
Faction administration tool
Read-only analytics or dashboard
Read-only analytics or dashboard
TypeScript type safety
The SDK exports anAllScopes type — a union of every valid scope literal — so TypeScript catches invalid scope strings at compile time: