2. Getting Started
This guide will help you get started with the Amadeus Protocol SDK in your project. We'll cover installation, basic setup, and your first queries and transactions.
Installation
Package Installation
Install the SDK using your preferred package manager:
# npm
npm install @amadeus-protocol/sdk
# yarn
yarn add @amadeus-protocol/sdk
# pnpm
pnpm add @amadeus-protocol/sdk
# bun
bun add @amadeus-protocol/sdkVerify Installation
After installation, verify the package is installed correctly:
# Check package version
npm list @amadeus-protocol/sdk
# Or check in your code
import { AmadeusSDK } from '@amadeus-protocol/sdk'
console.log('SDK Version:', AmadeusSDK.getVersion())Requirements
Node.js
The SDK requires Node.js version 20.0.0 or higher.
Check your Node.js version:
If you need to update Node.js, visit nodejs.org.
TypeScript (Optional)
TypeScript is optional but highly recommended. The SDK includes complete type definitions.
Install TypeScript:
Browser Support
The SDK works in modern browsers that support:
ES2020 features
fetch API (or polyfill)
Web Crypto API (for encryption features)
Basic Setup
Import the SDK
Initialize the SDK
Your First Query
Let's start with a simple chain query:
Your First Transaction
Here's how to build and submit a simple token transfer:
TypeScript Configuration
If using TypeScript, ensure your tsconfig.json includes:
Common Imports
Here are the most commonly used imports:
Troubleshooting Installation
"Module not found" Error
Problem: Cannot find module '@amadeus-protocol/sdk'
Solutions:
Ensure the package is installed:
Check your
package.json:Clear cache and reinstall:
TypeScript Errors
Problem: Type errors when importing
Solutions:
Ensure TypeScript is installed:
Check
tsconfig.json:Restart your TypeScript server/IDE
Node.js Version Issues
Problem: Errors related to Node.js version
Solutions:
Check Node.js version:
Update to Node.js 20+ if needed
Use a version manager like
nvm:
Next Steps
Now that you have the SDK installed and running:
Last updated