ts-sdk-client
TypeScript SDK: Aptos Client
Purpose
Guide creation and configuration of the Aptos client and AptosConfig in @aptos-labs/ts-sdk. One client
instance is used for all read/write and account/transaction APIs.
ALWAYS
- Create one Aptos instance per app (singleton) and reuse it – avoid multiple
new Aptos(config)for the same network. - Configure network via
AptosConfig– useNetwork.TESTNETorNetwork.MAINNET(or custom endpoints). - Use environment variables for network/URLs in production – e.g.
process.env.APTOS_NETWORKorimport.meta.env.VITE_APP_NETWORK. - Use
Network.TESTNETas default for development – devnet resets frequently.
NEVER
- Do not create a new Aptos client per request – reuse the singleton.
More from aptos-labs/aptos-agent-skills
use-ts-sdk
Orchestrates TypeScript SDK integration for Aptos dApps. Routes to granular skills for specific tasks (client setup,
33ts-sdk-account
How to create and use Account (signer) in @aptos-labs/ts-sdk. Covers Account.generate(), fromPrivateKey(),
33security-audit
Audits Move contracts for security vulnerabilities before deployment using 7-category checklist. Triggers on: 'audit
33ts-sdk-wallet-adapter
How to integrate wallet connection in React frontends using @aptos-labs/wallet-adapter-react. Covers
33ts-sdk-transactions
How to build, sign, submit, and simulate transactions in @aptos-labs/ts-sdk. Covers build.simple(),
32ts-sdk-address
How to create and use AccountAddress in @aptos-labs/ts-sdk. Covers address format (AIP-40),
31