Overview

The @atxp/common package provides shared utilities, types, and interfaces that are used across all ATXP SDK packages. This package contains the foundational building blocks for authentication, payment processing, and MCP integration.

Installation

This package is typically installed automatically as a dependency when you install other ATXP packages like @atxp/client or @atxp/express. You only need to install it directly if you’re building custom integrations or extending the ATXP SDK.
npm install @atxp/common

Client Types

Account

The Account class represents an ATXP account and handles authentication with the ATXP service.
import { Account } from '@atxp/common'

const account = new Account(connectionString)
connectionString
string
required
The ATXP connection string in the format: https://accounts.atxp.ai?connection_token=<token>
Example usage
import { Account } from '@atxp/common'

// Get connection string from environment variables
const connectionString = process.env.ATXP_CONNECTION_STRING
const account = new Account(connectionString)

ClientArgs

Configuration interface for creating ATXP clients.

AuthorizationData

Data structure returned when authorization succeeds.

PaymentData

Data structure returned when payment succeeds.

PaymentRequest

Data structure representing a payment request.

Error Types

AuthorizationError

Error thrown when authorization fails.

PaymentError

Error thrown when payment processing fails.

Server Types

ATXPArgs

Configuration interface for ATXP server middleware.