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/sdk

Verify 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.orgarrow-up-right.

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:

  1. Ensure the package is installed:

  2. Check your package.json:

  3. Clear cache and reinstall:

TypeScript Errors

Problem: Type errors when importing

Solutions:

  1. Ensure TypeScript is installed:

  2. Check tsconfig.json:

  3. Restart your TypeScript server/IDE

Node.js Version Issues

Problem: Errors related to Node.js version

Solutions:

  1. Check Node.js version:

  2. Update to Node.js 20+ if needed

  3. Use a version manager like nvm:

Next Steps

Now that you have the SDK installed and running:

Last updated