0.2.2 • Published 2 years ago

@stringpay/sdk v0.2.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

String SDK

Version Downloads

NodeJS TypeScript Svelte

Usage

Install the package through npm or yarn as follows:

npm i @stringpay/sdk
// or
yarn @stringpay/sdk

Load the SDK's script in the root of your app like so:

<script src="../node_modules/@stringpay/sdk/dist/stringpay-v0.2.0.min.js"></script>

Initialize the SDK in onMount (client side):

window.StringPay.init({
	env: "LOCAL", // Can be PROD, SANDBOX, DEV, or LOCAL
	publicKey: apiKey,
});

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';
0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago