Skip to main content

Amahub Docs | TypeScript SDK Best Practices

Build with Best Practices in Amahub Docs. Follow SDK concepts, transaction flow, signing, errors and testnet checks for reliable Amadeus app integrations.

This section focuses on best practices within the Amahub and Amadeus documentation stack, with practical context for JavaScript and TypeScript developers building on Amadeus.

Primary intentTypeScript SDK Best Practices
Best forJavascript and typescript developers building on amadeus

What you'll learn

  • Core API surface — use this as a checkpoint while working through 8. Best Practices.
  • Implementation flow — use this as a checkpoint while working through 8. Best Practices.
  • Error handling — use this as a checkpoint while working through 8. Best Practices.
  • Related SDK modules — use this as a checkpoint while working through 8. Best Practices.

Implementation flow

  1. Initialize the SDK against the intended network.
  2. Read chain or wallet state before constructing a transaction.
  3. Build, sign and submit transactions, then verify the resulting receipt or state change.

Operational and developer context

SDK integrations should separate reads, transaction construction, signing and submission. That makes retries safer, improves debugging and lets the application validate state before asking a user or backend signer to authorize a transaction.

Network mismatches, stale state, incorrect amount units and unsafe key handling are common integration errors. Validate inputs and handle node errors explicitly.

Checks and troubleshooting

  • Base URL is correct.
  • Base-unit and display-unit conversions are explicit.
  • Read, build, sign and submit stages are logged separately.
  • Node errors are surfaced instead of replaced with generic failures.
Decision rule: if a workflow changes balances, signs transactions, deploys code or changes node configuration, validate it in a non-production environment first and record the exact network used.

FAQ

What does TypeScript SDK Best Practices cover?

It covers the official TypeScript/JavaScript SDK, transactions, keys, chain queries and contract interactions with implementation and operational context for JavaScript and TypeScript developers building on Amadeus.

Should I use testnet before using Best Practices in production?

Yes for new integrations and operational changes. Validate network configuration, signing behavior, error handling and expected state changes in a non-production environment first.

What is the most important troubleshooting check?

Confirm network configuration, amount units, signer state and the node error returned by the failed request.