Skip to content

API Reference

This section provides detailed documentation for all classes, methods, and types in the TapTap PC SDK.

Main Classes

ClassDescription
TapSdkMain SDK class for initialization, authentication, and ownership
CloudSaveCloud save functionality for game saves

Exports

The package exports the following:

typescript
import {
  // Classes
  TapSdk,
  CloudSave,
  
  // Constants
  EventId,
  SystemState,
  
  // Types
  type TapEvent,
  type AuthToken,
  type SdkError,
  type CloudSaveInfo,
  type CreateSaveRequest,
  type UpdateSaveRequest,
  // ... and more event types
} from 'tapsdk-pc';

Quick Reference

TapSdk Methods

MethodDescription
TapSdk.restartAppIfNecessary(clientId)Check if app needs restart
new TapSdk(pubKey)Initialize the SDK
TapSdk.isInitialized()Check if SDK is initialized
sdk.getClientId()Get the client ID
sdk.runCallbacks()Poll for events
sdk.authorize(scopes)Request user authorization
sdk.getOpenId()Get user's OpenID
sdk.isGameOwned()Check if user owns game
sdk.isDlcOwned(dlcId)Check if user owns DLC
sdk.showDlcStore(dlcId)Open DLC store page
sdk.shutdown()Shut down the SDK

CloudSave Methods

MethodDescription
CloudSave.get()Get singleton instance
cloudSave.list(requestId)List all saves
cloudSave.create(requestId, request)Create a new save
cloudSave.update(requestId, request)Update existing save
cloudSave.delete(requestId, uuid)Delete a save
cloudSave.getData(requestId, uuid, fileId)Download save data
cloudSave.getCover(requestId, uuid, fileId)Download save cover

Event Types

Event IDConstantDescription
1SYSTEM_STATE_CHANGEDPlatform online/offline/shutdown
2002AUTHORIZE_FINISHEDAuth flow completed
4001GAME_PLAYABLE_STATUS_CHANGEDGame ownership changed
4002DLC_PLAYABLE_STATUS_CHANGEDDLC ownership changed
6001CLOUD_SAVE_LISTSave list response
6002CLOUD_SAVE_CREATESave created
6003CLOUD_SAVE_UPDATESave updated
6004CLOUD_SAVE_DELETESave deleted
6005CLOUD_SAVE_GET_DATASave data downloaded
6006CLOUD_SAVE_GET_COVERCover image downloaded

Released under the MIT License.