Skip to content

docs: server SDK parity (Go, Rust, Python full rewrites)#2

Open
turnkeyintern wants to merge 1 commit intomainfrom
docs/server-sdk-parity
Open

docs: server SDK parity (Go, Rust, Python full rewrites)#2
turnkeyintern wants to merge 1 commit intomainfrom
docs/server-sdk-parity

Conversation

@turnkeyintern
Copy link
Owner

Summary

This PR fills critical documentation gaps for the Go, Rust, and Python server SDKs, and updates the server SDK capability table in the introduction page.

Changes

1. sdks/golang.mdx — Full Rewrite

Previous state: Empty page with only title and GitHub link.

New content:

  • Overview of SDK architecture (swagger-generated client + handwritten auth/crypto)
  • Installation instructions
  • Authentication with all three signature schemes (P-256, secp256k1, ED25519 — unique to Go)
  • Client setup with the client.Authenticator pattern (documented the gotcha that it must be passed to every call)
  • Usage examples: Whoami, Create Wallet, Sign Message, Email OTP flow
  • Activity polling pattern (Go does NOT auto-poll unlike Rust/TS)
  • HPKE encryption for wallet export
  • Nitro attestation verification
  • Ethereum integration with go-ethereum
  • Links to examples folder

2. sdks/rust.mdx — Full Rewrite

Previous state: Empty page with only title and GitHub link.

New content:

  • Overview of all four crates (turnkey_client, turnkey_api_key_stamper, turnkey_enclave_encrypt, turnkey_proofs)
  • Installation via cargo
  • Authentication with P-256 and secp256k1 stampers
  • Client setup with builder pattern and retry configuration
  • Usage examples: Whoami, Create Wallet, Sign Message, Email OTP
  • Activity auto-polling with exponential backoff (highlight that this is built-in)
  • HPKE for wallet export/import
  • Nitro attestation verification
  • Gas station support
  • TVC CLI mention
  • Code quality notes (#![forbid(unsafe_code)])

3. sdks/python.mdx — Full Rewrite (fixes critical errors)

Previous state: WRONG — said "we do not yet offer a full SDK for Rust" (copy-paste error that should say Python). Claimed Python had no real SDK when tkhq/python-sdk is a full SDK with 100+ typed methods.

New content:

  • Overview of all three packages (turnkey-http, turnkey-api-key-stamper, turnkey-sdk-types)
  • Installation via pip
  • Authentication with ApiKeyStamper
  • Client setup with all configuration options
  • Usage examples: Whoami, Create Wallet, Sign Message, Email OTP
  • Stamp-then-send pattern
  • Activity polling behavior (documented the blocking time.sleep() caveat for async frameworks)
  • Limitations section (no async, no HPKE, P-256 only, low default retries)
  • Integration examples for Flask, FastAPI (with thread pool workaround), and Django

4. sdks/introduction.mdx — Server SDK Table Update

Previous state: Only 3 rows (Authentication, Wallet Management, Policy Management) with missing checkmarks for Rust and Python.

New content: Added 5 new rows:

Capability TS Go Ruby Rust Python
Activity Auto-Polling ✅*
HPKE (Export Decrypt)
Nitro Attestation
Gas Station
ED25519 API Key Signing

* Python's polling uses blocking time.sleep() — added footnote explaining this.

Also fixed missing checkmarks for Rust and Python in Wallet Management and Policy Management rows.

Source Material

All content is based on direct analysis of the SDK repositories:

  • Go SDK: github.com/tkhq/go-sdk
  • Rust SDK: github.com/tkhq/rust-sdk
  • Python SDK: github.com/tkhq/python-sdk

Detailed learnings documented in: https://github.com/turnkeyintern/learnings

Testing

  • All code examples are based on actual SDK usage patterns
  • Verified against SDK repository examples and tests
  • Matched existing doc style (Ruby, TypeScript Server pages)

- Go SDK (golang.mdx): Full rewrite with installation, auth (P-256, secp256k1, ED25519),
  client setup, examples (whoami, wallet, signing, email OTP), activity polling
  pattern (manual - no auto-poll), HPKE encryption, Nitro attestation verification,
  and Ethereum integration guide

- Rust SDK (rust.mdx): Full rewrite covering all four crates (client, stamper,
  enclave_encrypt, proofs), async client with auto-polling and exponential backoff,
  HPKE for wallet import/export, Nitro attestation, gas station support, and
  TVC CLI mention

- Python SDK (python.mdx): Complete rewrite fixing critical errors (old page
  incorrectly said Python had no SDK). Documents all three packages, Pydantic v2
  types, activity polling with blocking time.sleep() caveat, stamp-then-send
  pattern, and limitations (no async, no HPKE, P-256 only)

- Introduction (introduction.mdx): Expanded server SDK capability table with
  Activity Auto-Polling, HPKE support, Nitro Attestation, Gas Station, and
  ED25519 API Key Signing rows. Fixed missing checkmarks for Rust/Python.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants