orchard.js with a script tag, create a session with your API key, and open the investment flow when a user clicks a button. No package manager or build step is required.
1
Load the SDK
Add the Orchard script to your page. It exposes the
window.OrchardSDK constructor.2
Load investment directly without a button to trigger
Request a session token, create an
OrchardSDK instance, and call open() with your callbacks.index.html
3
Load Investment with a button as trigger
Add the element users click to start investing. The example below listens on an element with the ID
invest.Configuration
string
required
Your Orchard public key, starting with
pk_.string
required
The Orchard embed API URL, for example
https://core.orchard.africa/api/v1/embed.string
required
The token returned in
data.token from POST {apiUrl}/session.Callbacks
Pass these toorchard.open():