0.1.8 • Published 2 years ago
@stringpay/sdk-dev v0.1.8
String SDK
Usage
Install the package through npm
or yarn
as follows:
npm i @stringpay/sdk
// or
yarn @stringpay/sdk
Load the SDK's script on your app like so:
<script src="../node_modules/@stringpay/sdk/dist/stringpay-v0.0.1.min.js"></script>
With this in place, add your String Checkout
button anywhere you'd like:
<button onClick={() => StringPay.loadFrame(payload)}>String Checkout</button>
The StringPay
object can be fetched from the window
object.
Add a div anywhere on your app where you'd like to render the payment modal:
<div class="string-pay-frame" />
Refer to our documentation for more in-depth explanations and help regarding transaction payload formats.
Types
The SDK's types can be imported if necessary. For example:
import type { StringPayload } from '@stringpay/sdk';