Smile Coin SDK For React
1. Download SDK
npm i smilecoin-sdk-node
2. Import package
const smileSDK = require("smilecoin-sdk-node");
3. Initialize SDK with api_key:
smileSDK.sdk.init(
"api_key", //api_key (String: your api_key)
"testnet", //environ: (String: chosen environment, "testnet" || "mainnet")
);
4. Receive payment:
Smile Coin React SDK is
recommended for obtaining the signed_txn
from your client.
smileSDK.sdk.receive(
signed_txn, //signed_txn (Object: returned by the SmileReceiveButton callback, link above)
10, //usd_amount: (Number: expected amount of USD),
"user123", //uuid: (String: user specific id of your platform)
);