@getsupertab/supertab-js 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/dist/pkg/prod/sdk-Ds6nrDir.js +33469 -0
- package/dist/pkg/prod/sdk.d.ts +460 -0
- package/dist/pkg/prod/sdk.js +4 -0
- package/dist/pkg/prod/sentry-DqG34jME.js +42 -0
- package/dist/pkg/prod/style-o8z2wF2u.js +4 -0
- package/package.json +114 -0
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Supertab.js
|
|
2
|
+
|
|
3
|
+
This package allows [Supertab.js](https://docs.supertab.co/) to be imported as an ES module. It includes TypeScript declarations.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@getsupertab/supertab-js)
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Use `npm` to install the Supertab.js module:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @getsupertab/supertab-js
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage Example
|
|
15
|
+
|
|
16
|
+
Run the following code in a browser environment, it won't work on the server-side.
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
import Supertab from "@getsupertab/supertab-js";
|
|
20
|
+
|
|
21
|
+
const supertab = new Supertab({
|
|
22
|
+
clientId: "client.xyz",
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const { show } = supertab.createPaygate({
|
|
26
|
+
experienceId: "experience.xyz",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const paygateResult = await show();
|
|
30
|
+
console.log(paygateResult);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This example creates a new Supertab.js instance using the `new Supertab()` constructor.
|
|
34
|
+
Then, the `createPaygate` method is used to create a new paygate.
|
|
35
|
+
The `show` function renders the paygate. Finally, once the user has completed or cancelled the purchase,
|
|
36
|
+
we print the result data to the browser console.
|
|
37
|
+
|
|
38
|
+
We've put a placeholder client ID and experience ID in this example.
|
|
39
|
+
Replace them with your actual IDs to test this code with your Supertab.js merchant account.
|
|
40
|
+
Each experience has a corresponding client ID and experience ID. You can find them in the [Supertab Business Portal](https://business.supertab.co)
|
|
41
|
+
under "Experiences" -> Pencil icon (edit) -> "Installation" -> "Code Snippet".
|
|
42
|
+
|
|
43
|
+
## Links
|
|
44
|
+
|
|
45
|
+
- [Supertab Docs](https://docs.supertab.co/)
|
|
46
|
+
- [Supertab Business Portal](https://business.supertab.co)
|