Skip to main content
Every Orchard SDK request carries two credentials: your organization’s API key and a session token for the current user. You pass both once when you create the client, and the SDK adds them to every call.

Client configuration

string
required
Base URL of the Orchard API. A trailing slash is removed automatically.
string
required
Token identifying the signed-in user. Sent as a bearer token.
string
required
Your Orchard API key. Sent in the X-Orchard-Key header.

Request headers

The client sends these headers on every request:

Getting credentials

Contact the Orchard team to get your API key and the API base URL for each environment. Ask how session tokens are issued for your integration, since the token identifies the end user making the investment.
The SDK runs in the browser, so any value passed to the client is visible to the user. Keep long-lived secrets on your server and issue short-lived session tokens to the browser where possible.

Authentication errors

If a request fails, the client throws an Error whose message is the message field from the API response, or Orchard API request failed. when none is returned.