For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

The official TypeScript/JavaScript SDK for the AstraPay API. Zero runtime dependencies — uses native fetch.

Package: @astra-pay/sdk Requires: Node.js >= 18.0.0


Installation

npm install @astra-pay/sdk
# or
yarn add @astra-pay/sdk

Quick start

import { AstraPayClient } from "@astra-pay/sdk";

const client = new AstraPayClient("ap_live_your_api_key");

const payment = await client.payments.create({
  amount: 49.99,
  token: "USDC",
  network: "BASE",
  customer_email: "john@example.com",
  redirect_url: "https://yourapp.com/success",
});

console.log(payment.checkout_url);
// => "https://pay.byastra.ai/purchases/pXk9mQ"

Constructor

Parameter
Type
Default
Description

apiKey

string

Your API key (required)

options.baseUrl

string

https://apipay.byastra.ai

Override API base URL

options.prefix

string

/v1

API route prefix


Available modules

Module
Description

Create, get, list, cancel payments

Full CRUD on products

Register and manage webhooks

Last updated