← All posts

Trustware widget, headless SDK, or REST API: which should you use?

Choose your Trustware integration around the interface you need, where your transaction logic runs, and who manages signing. Use the widget for a prebuilt React transaction flow, the headless SDK for a custom React interface, and the REST API for backend services or applications outside React.

An existing host wallet is a separate decision. It lets you reuse your application's wallet connection; it is not another cross-chain bridge or a fourth routing product.

Trustware connects your application's transaction logic to routing and settlement. Across these integration paths, your application retains control over signing and the business logic that responds to transaction outcomes.

Compare the integration paths

Requirement Starting point What your application owns
Prebuilt React deposit interface Widget Destination configuration and surrounding application behavior
Prebuilt interface with an existing wallet connection Widget with host wallet Existing wallet state, configuration, and surrounding application behavior
Custom React transaction interface Headless SDK Screens, interaction flow, and application-specific completion logic
Backend service or non-React application REST API Signing integration, broadcast, receipt submission, status handling, and business logic
Deposit into a vault supported by Earn Prebuilt Earn screen in the swap widget, headless SDK, or REST API Vault selection, integration behavior, and outcome verification; Trustware constructs the deposit call
Custom destination contract call Headless SDK or REST API Calldata, contract compatibility, beneficiary handling, and outcome verification

The paths share routing infrastructure, but they do not expose identical features. Custom destination hooks are not available through the widget or runTopUp(). The swap widget does support deposits into supported Earn vaults, with Trustware constructing the deposit call.

Choose the widget when the built-in flow fits

The widget provides wallet selection, token selection, amount entry, confirmation, and result screens. It is a practical starting point when your product needs a deposit interface and does not require a custom interaction model.

If the application does not already manage wallet state, the drop-in pattern uses Trustware's wallet discovery. If the application already manages a connected wallet, pass that wallet into the integration instead.

The swap widget's Earn screen supports deposits into supported yield vaults. If your application needs to supply its own contract target and calldata, use a custom destination posthook through the headless SDK or REST API instead.

Start with the drop-in widget guide.

Keep your existing wallet connection

An application using Wagmi, RainbowKit, or another supported adapter does not need a second wallet connection flow simply to add Trustware.

The host-wallet pattern passes the existing wallet to TrustwareProvider and disables SDK discovery with autoDetect={false}. That keeps wallet ownership in the host application while using the widget's interface.

For an embedded wallet, use the adapter and setup documented for that provider interface. Do not infer support for every wallet adapter from the existence of the host-wallet pattern.

See connect your existing wallet for the documented Wagmi, viem, and EIP-1193 patterns.

Choose the headless SDK when you need your own interface

The headless core exposes routing and transaction operations without requiring the widget. You build the screens and decide how the transaction fits into the product.

Use it when the flow belongs inside an existing interface, needs custom confirmation steps, or includes a custom destination contract call. You can also use headless Earn for supported vaults while building your own interface; Trustware still constructs the deposit call. The documented React setup uses TrustwareProvider for configuration context; “headless” does not mean it is a standalone backend service.

You also own more of the integration behavior. Review the actual route before signing, handle the relevant errors, and use the correct execution helper for the source chain. For flows that may send a Solana route, the current documentation specifies the reviewed-route helpers so a stale blockhash is not carried from review into signing.

Read the headless core reference for the current helpers, receipt behavior, and version requirements.

Choose REST for backend-controlled workflows

The REST API fits backend services, internal workflows, and applications outside React. Your application requests a route, signs and broadcasts through its own infrastructure, submits the transaction receipt, and tracks settlement.

This separation is useful when the system that decides to initiate a transaction is not a browser interface. It does not transfer signing authority to Trustware: private keys remain with your wallet or signing infrastructure.

Your application remains responsible for required source-token approvals and for interpreting the final outcome. If the request includes a destination call, verify that contract's result before triggering dependent business actions.

Follow the REST API overview for authentication and the integration lifecycle.

Decide on capabilities before choosing the interface

Answer these questions before committing to an integration path:

  1. Does the transaction run in a React interface, a non-React application, or a backend service?
  2. Does the product already manage the user's wallet connection?
  3. Can the prebuilt flow express the experience you need?
  4. Are you sending funds to an address, depositing into a supported Earn vault, or supplying your own destination contract call?
  5. What evidence will your application require before showing completion or recognizing credit?

For a supported Earn vault, choose the prebuilt Earn screen, headless SDK or REST API. For a custom destination contract call, use headless or REST. The Earn versus custom-call comparison explains which responsibilities each option leaves with your application.

Frequently asked questions

Is the host-wallet bridge a separate routing integration?

No. It connects a wallet your application already manages to Trustware. Wallet ownership and transaction-interface choice are related but separate decisions.

Do the widget and headless SDK support the same features?

Not every feature. Both offer Earn flows for supported vaults, but custom destination hooks require the headless SDK or REST API. The widget and runTopUp() do not accept custom hooks.

Can I move from the widget to a custom interface later?

Yes, but plan for implementation work. Shared routing concepts do not remove the need to build screens, wire execution, and test error and completion handling in the new interface.

Does the REST API require Trustware to hold my keys?

No. Your signing infrastructure signs and broadcasts the source transaction. Trustware prepares the route and tracks settlement without holding private keys or taking custody of funds.

Which option should I start with?

Start with the widget if its interface and capabilities fit, including the Earn screen for supported vaults. Choose headless for a custom React interface or custom destination calls, and REST when your workflow runs outside React or needs backend-controlled integration.

Start with the matching guide

Use the widget guide, host-wallet guide, headless reference, or REST API overview. Evaluate the features your flow needs before choosing how much interface code to own.