Package Installation
Install the AttestProtocol SDK using your preferred package manager:Peer Dependencies
Install blockchain-specific dependencies based on your target chains:Installing all dependencies is recommended if you plan to support multiple blockchains or are unsure which chain you’ll use.
Requirements
Requirement | Version |
---|---|
Node.js | >= 16.0 |
TypeScript | >= 4.5 |
npm/pnpm/yarn | Latest stable |
Module Formats
The SDK supports multiple module formats for different environments:TypeScript Configuration
TypeScript is recommended for better type safety and developer experience.
tsconfig.json
:
tsconfig.json
Browser Configuration
Browser environments require polyfills for Node.js crypto and buffer modules.
Verification
Verify your installation is working correctly:Build Outputs
The SDK provides multiple build outputs for different use cases:Format | Path | Usage |
---|---|---|
CommonJS | dist/main/index.js | Node.js applications |
ES Modules | dist/module/index.js | Modern bundlers |
UMD | dist/umd/attestprotocol.js | Browser/CDN usage |
TypeScript | dist/index.d.ts | Type definitions |
Troubleshooting
Module not found errors
Module not found errors
Clear your cache and reinstall:
TypeScript compilation errors
TypeScript compilation errors
- Ensure TypeScript version >= 4.5
- Verify
tsconfig.json
settings match recommendations - Install Node.js types:
npm install -D @types/node
Browser build issues
Browser build issues
- Configure polyfills as shown above
- Check for conflicting global definitions
- Ensure bundler supports ES modules
Peer dependency warnings
Peer dependency warnings
Install missing peer dependencies:
Version Compatibility
SDK Version | Stellar SDK | Anchor | Node.js |
---|---|---|---|
1.x | ^12.0.0 | ^0.30.0 | >=16 |
2.x | ^13.0.0 | ^0.30.0 | >=18 |
Always use the latest stable version for the best performance and security updates.