Recur Docs

Advanced / Custom Web3

Low-level @recur/sdk builders for full control over transactions and signing.

Advanced / Custom Web3

Most apps should use Integration instead. This section is for builders who want to construct, inspect, or modify on-chain transactions directly — for example to bundle Recur with other instructions in the same transaction, ship a custom wallet flow, or run server-side keepers.

The @recur/sdk package exposes raw builders for every on-chain operation, plus REST wrappers and webhook primitives.

When to use this layer

  • You compose Recur with other Solana instructions in a single transaction
  • You sign with a non-standard wallet (HSM, MPC, custodian)
  • You build merchant tooling that bypasses the React/JWT flow
  • You're writing tests or scripts against the protocol

For everything else — drop-in components, hooks, server-side helpers, and webhook verification — start at /docs/integration.

Subscriber operations

  • Quickstart — install and configure RecurClient
  • SubscribebuildSubscribeTransaction, buildReapproveTransaction
  • CancelbuildCancelTransaction, buildFinalizeCancelTransaction, buildSubscriberCancelTransaction
  • SubscriptionsgetMySubscriptions, getSubscription, registerSubscription, getSubscriptionAccount, deriveSubscriptionPda

Merchant operations

API-key-authenticated REST wrappers:

  • PlanscreatePlan, listPlans, getPlan, getPlans
  • SubscriptionslistSubscriptions, getPaymentHistory

Webhooks (low-level)

  • WebhooksverifyWebhookSignature, parseWebhookPayload

For framework-aware middleware (Express, Next.js, Node) prefer @recur/server, which delegates to the same primitives.

High-level helpers (also on RecurClient)

The same orchestration the React hooks use is available directly on the client. See Server-side helpers for details.

MethodEquivalent low-level calls
client.authenticate(wallet)POST /auth/noncewallet.signMessagePOST /auth/verify
client.subscribe(wallet, options, token)buildSubscribeTransaction → sign+send → registerSubscription
client.cancel(wallet, options)buildCancelTransaction or buildSubscriberCancelTransaction → sign+send
client.reapprove(wallet, options)buildReapproveTransaction → sign+send

Re-exports

The SDK re-exports useful helpers and types so you don't need to depend on @recur/solana-client or @recur/types directly:

Re-exportSourceDescription
PROGRAM_ID@recur/solana-clientDefault devnet program ID
USDC_MINT_DEVNET@recur/solana-clientDevnet mock USDC mint
findSubscriptionPda@recur/solana-clientPDA derivation
findTreasuryVaultPda@recur/solana-clientTreasury PDA derivation
planSeedToBuffer@recur/solana-clientHex → 8-byte Buffer
planSeedToArray@recur/solana-clientHex → number[] for Anchor
EventType@recur/typesWebhook event union
SubscriptionStatus@recur/typesactive | past_due | cancelled | expired
WebhookPayload@recur/typesWebhook payload shape
RecurError (and subclasses)Typed error hierarchy
getClusterDefaultscluster → { rpcUrl, programId, usdcMint }
signAndSendWallet → tx → send → confirm pipeline
unwrapThrow on { success: false } envelopes

On this page