@supermojo-official/client-sdk-react
Supermojo allows marketplaces to accept credit card payments from customers who want to purchase non-fungible tokens (NFTs) without first signing up for a wallet and managing cryptocurrency. This SDK is meant for partners who want to embed a 'Pay with Supermojo' button for a seamless card on-ramp experience.
Prerequisites
Node v16.15.0
NPM 8.5.0
IDE (eg. Visual Studio Code)
Showcase marketplace
You can also checkout a [Showcase] marketplace for example usage. (https://marketplace.supermojo.xyz/)
React SDK Usage
-
You will need to contact partners@supermojo.com to receive a
ClientID
-
Once you receive a
ClientID
, you can start to integrate the SDK into your marketplace frontend.
First install the SDK
npm install @supermojo-official/client-sdk-react
Then, import the package
import { SupermojoPayButton } from '@supermojo-official/client-sdk-react';
Finally render the 'Pay with Supermojo' button
<SupermojoPayButton
contractAddress="CONTACT_ADDRESS"
tokenId="TOKEN_ID"
clientId="YOUR_CLIENT_ID"
targetEnv="qa" //optional
/>
Parameter | Required? | Default | Type | Description |
---|---|---|---|---|
clientId | Yes | " |
string |
Set ClientId provided by the Supermojo team |
contractAddress | Yes | - |
string |
Purchase Contract address, supplied by the Marketplace |
tokenId | Yes | "" |
string |
NFT token ID, supplied by the Marketplace |
targetEnv | No | " |
string |
Pick between [local / demo / qa / uat] environments |
If you need to use a vanilla-JS SDK instead, reach out to the Supermojo team partners@supermojo.com.
License
This software is released under the MIT license.