Skip to main content
Get a complete subscription lifecycle running on Stellar in under 5 minutes.
This guide uses the Vowena TypeScript SDK. You’ll need Node.js 18+ and a Stellar account with USDC.
1

Install the SDK

Add the Vowena SDK to your project.
The SDK is a lightweight wrapper around the Vowena Soroban contract. It builds transactions locally - you sign and submit them with your own wallet or keypair.
2

Create a Client

Initialize the VowenaClient with your network configuration.
NETWORKS.mainnet provides pre-configured values for contractId, rpcUrl, networkPassphrase, and usdcAddress so you don’t need to look them up.
3

Create a Plan (Merchant)

Define a subscription plan. This is an on-chain transaction that stores the plan parameters permanently.
Plans are immutable once created. If you need to change pricing, create a new plan and use the migration flow to move existing subscribers.
toStroops("9.99") converts a human-readable amount to the 7-decimal-place integer format used by Stellar tokens. It returns a BigInt:
USDC on Stellar uses 7 decimal places (stroops), matching the native XLM precision.
4

Subscribe (Subscriber)

A subscriber authorizes the plan. This single transaction calls subscribe() on the Vowena contract and sets the SEP-41 token allowance - one signature covers both.
The subscriber’s wallet will display exactly what is being approved: the token (USDC), the spending ceiling (price_ceiling from the plan), and the contract authorized to pull funds. Full transparency - no hidden permissions.
5

Charge (Keeper / Anyone)

Once a billing period has elapsed, anyone can trigger the charge. The contract validates all conditions on-chain.
The contract checks:
  • Is the subscription active?
  • Has enough time passed since the last charge?
  • Is the trial period over?
  • Does the subscriber have sufficient balance and allowance?
  • Has the max period limit been reached?
If all checks pass, USDC is transferred from the subscriber directly to the merchant via transfer_from().
You don’t need to run your own keeper. The Vowena Dashboard includes a built-in keeper service, or you can use third-party keeper networks.
6

Cancel

Either the subscriber or the merchant can cancel a subscription at any time.
Cancellation is immediate and on-chain. No approval from the merchant is needed. The subscriber can also cancel directly through any Stellar wallet or block explorer that supports Soroban contract invocations - the Vowena frontend is not required.

Full Example

Here’s the complete flow in a single script:

Next Steps

Core Concepts

Understand plans, subscriptions, allowances, and the billing lifecycle in depth.

How It Works

Visual walkthrough of the full protocol flow - from plan creation to cancellation.

SDK Reference

Complete SDK documentation with all methods, types, and configuration options.

Run a Keeper

Set up an automated keeper bot to charge subscriptions on schedule.