@trustshare/sdk
v2.0.3
Published
trustshare client-side SDK
Downloads
266
Keywords
Readme
📖 Documentation
See our in-depth documentation to learn how you can use the trustshare client SDK to integrate with our API.
🔧 Installation
To use the client SDK on your front-end, you can easily install our package from NPM:
# via npm:
npm install --save @trustshare/sdk
# via yarn
yarn add @trustshare/sdk
Alternatively, you can also include the client SDK directly in your page source, using the below snippet.
<script async defer src="https://unpkg.com/@trustshare/sdk/dist/index.js"></script>
You can also use our module bundle via a modern import statement.
<script type="module">
import sdk from 'https://unpkg.com/@trustshare/sdk/dist/index.esm.js'
</script>
🚀 Quick start
To use our SDK, you will need to sign up or log in to the dashboard to acquire a public API key used to instantiate the client SDK. You can use our handy getting started guide that describes setting up your organisation on the dashboard.
Once you have access to your organisation's public key, you can easily instantiate and start using the client SDK. The trustshare client SDK works across all modern desktop and mobile browsers. With all this out of the way, you can use the newly set up SDK to achieve tasks needed for integration such as confirming a payment intent.
import sdk from '@trustshare/sdk';
const trustshare = sdk('<YOUR_PUBLIC_API_KEY>');
const result = await trustshare.sdk.v1.confirmPaymentIntent('<intent_secret>');