Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.stellartools.dev/llms.txt

Use this file to discover all available pages before exploring further.

StellarTools marketplace apps are web apps that run inside an iframe embedded directly in the dashboard. Your app receives the active organization’s context and can subscribe to real-time payment events.

Install the bridge

The only frontend dependency you need:
npm install @stellartools/app-embed-bridge

Initialize in your React app

Call stellar.init() once on mount. It reads context from URL params injected by StellarTools, starts an auto-resize observer so your iframe fits its content, and returns the context object.
import { useEffect, useState } from "react";

import { stellar } from "@stellartools/app-embed-bridge";

export default function App() {
  const [ctx, setCtx] = useState(null);

  useEffect(() => {
    const context = stellar.init((update) => {
      // called whenever the host broadcasts a context change
      setCtx((prev) => ({ ...prev, ...update }));
    });
    setCtx(context);
  }, []);

  if (!ctx) return null;

  return (
    <div>
      Org: {ctx.organizationId} · Env: {ctx.environment}
    </div>
  );
}

Context fields

FieldTypeDescription
organizationIdstringThe active organization
environment"testnet" | "mainnet"Which network the org is on
theme"light" | "dark"The dashboard theme
pathnamestringThe current dashboard route
installationIdstringUnique ID for this org’s installation — use it to key your backend records

Host communication

stellar.navigate("/payments"); // push the user to a dashboard route
stellar.reload(); // tell the host to refetch its data

Define your manifest

When submitting your app you provide a manifest that declares exactly what it needs. Users see your scopes and events before they install.
{
  "name": "My App",
  "description": "A short description shown in the marketplace (max 200 chars).",
  "homepageUrl": "https://myapp.com",
  "baseUrl": "https://myapp.com/stellartools",
  "webhookUrl": "https://myapp.com/webhooks/stellar",
  "scopes": ["read:customers", "read:payments"],
  "version": "1.0.0"
}
name
string
required
Display name shown in the marketplace. 2–50 characters.
description
string
required
Short description shown on the listing card. Max 200 characters.
homepageUrl
string
required
Your app’s public homepage.
baseUrl
string
required
The URL StellarTools loads inside the iframe. Context params are appended as query strings automatically.
webhookUrl
string
If provided, StellarTools will POST signed event payloads here. Omit if you don’t need event subscriptions.
scopes
string[]
required
At least one scope is required. Declare only what your app actually needs — users see the full list before installing.
events
string[]
Event types to subscribe to. Only relevant if you have a webhookUrl.
version
string
Semantic version of your app. Defaults to 1.0.0.

Scopes

Scopes follow the pattern read:resource or write:resource.
ScopeWhat it grants
read:customers / write:customersCustomer records
read:payments / write:paymentsPayment history and status
read:subscriptions / write:subscriptionsSubscription lifecycle
read:checkouts / write:checkoutsCheckout sessions
read:payouts / write:payoutsPayout records
read:refunds / write:refundsRefund records
read:payment_methods / write:payment_methodsSaved payment methods
read:products / write:productsProduct catalog
read:portalCustomer portal sessions
*All resources, shown prominently to users and to be used sparingly

Webhook events

When a matching event fires, StellarTools POSTs a signed payload to your webhookUrl.
import type { WebhookEvent } from "@stellartools/core";

app.post("/webhooks/stellar", (req, res) => {
  const event = req.body as WebhookEvent;

  switch (event.type) {
    case "payment.confirmed":
      await syncPayment(event.data.object);
      break;
    case "subscription.canceled":
      await handleChurn(event.data.object);
      break;
  }

  res.status(200).send("ok");
});

Available events

EventFires when
payment.confirmedA payment is confirmed on-chain
payment.pendingA payment is pending
payment.failedA payment fails
customer.createdA new customer is created
customer.updatedCustomer details change
customer.deletedA customer is deleted
checkout.createdA checkout session opens
subscription.createdA subscription starts
subscription.updatedA subscription is modified
subscription.canceledA subscription is canceled
refund.succeededA refund is issued
refund.failedA refund fails
payment_method.createdA payment method is saved
payment_method.deletedA payment method is removed

Submit your app

App submission is not yet open. Email odii@stellartools.dev to join the early-access list for publishers.