Configure the SDK
Everything runs through one object: TrustlineOnboarder. Construct it once with your network and sponsor, and reuse it.
Construct the onboarder
The SDK never holds keys, and the sponsor is always bring-your-own. You pass a network and a sponsor configuration; Horizon and RPC URLs default per network but can be overridden.
The sponsor
The sponsor pays the trustline reserve so the user needs no XLM. It can be a key your service controls, or a callback into a KMS/HSM. Sponsorship is bounded per account and per time window, and is only granted against a real pending onboarding.
Point at an approval server
For a regulated asset, the SDK forwards the built transaction to the issuer’s approval server, which runs the compliance check and signs the authorization. You usually don’t configure this directly — the URL is discovered from the issuer’s stellar.toml — but you can override it:
Discovery via stellar.toml
Point the SDK at an issuer’s stellar.toml. It advertises the asset, the approval server URL, and the supported mechanisms — so a wallet can find the onboarding service from the asset alone.