The Turnkey SDK distributes types across several packages. Most types you need are re-exported by the higher-level packages, but you can always import directly from the source package for precision.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tkhq/sdk/llms.txt
Use this file to discover all available pages before exploring further.
@turnkey/sdk-server and @turnkey/react-wallet-kit both re-export the types they depend on, so in most cases you will not need to install @turnkey/sdk-types or @turnkey/http separately just to access types.Type sources
| Package | What it provides |
|---|---|
@turnkey/sdk-types | Shared session, auth, and error types; generated protobuf types |
@turnkey/http | Activity types, signed request types, and the full TurnkeyApiTypes namespace |
@turnkey/sdk-server | Server-side config and proxy handler types |
Core types
Session
Auth results
TActivity
Represents a Turnkey activity object. Sourced from the generated API types.Unique identifier for the activity.
Current status:
ACTIVITY_STATUS_CREATED, ACTIVITY_STATUS_PENDING, ACTIVITY_STATUS_CONSENSUS_NEEDED, ACTIVITY_STATUS_COMPLETED, ACTIVITY_STATUS_FAILED, or ACTIVITY_STATUS_REJECTED.The kind of mutation — for example,
ACTIVITY_TYPE_CREATE_PRIVATE_KEYS or ACTIVITY_TYPE_SIGN_RAW_PAYLOAD.The organization that owns this activity.
Present only when
status is ACTIVITY_STATUS_COMPLETED. Contains the operation-specific result (e.g. signRawPayloadResult, createPrivateKeysResultV2).TSignedRequest
A fully signed request ready to be forwarded to Turnkey. Returned by allstamp* methods on TurnkeyClient.
TurnkeyApiTypes namespace
TurnkeyApiTypes exposes every definition from the Turnkey OpenAPI spec as a TypeScript type. Use it to reference request/response shapes without importing individual named types.
Error types
| Class | Package | When thrown |
|---|---|---|
TurnkeyRequestError | @turnkey/http | Non-2xx HTTP response from the API |
TurnkeyActivityError | @turnkey/http | Activity reaches FAILED or REJECTED |
TurnkeyActivityConsensusNeededError | @turnkey/http | Activity requires consensus approvals |
TurnkeyError | @turnkey/sdk-types | General SDK errors (higher-level packages) |
TurnkeyNetworkError | @turnkey/sdk-types | Network-level errors in higher-level packages |
TurnkeyErrorCodes is a large enum covering all error conditions surfaced by the SDK. Import it from @turnkey/sdk-types when you need to branch on a specific error code: