Slyk
Search…
Quick Start Guide
All you need to start developing and integrating Slyk in no time
Learn by example: a journey from setup to sale
To help you integrate Slyk in no time we’ve put together a step-by-step guide with everything that you need to do from setup to charging an user.

Step 1 - Setup

  1. 1.
    Go to your Slyk dashboard.
  2. 2.
    On the main menu, go to Credentials and click on the CREATE NEW API KEY button.

Step 2 - Create a Wallet

You can create a new wallet on the dashboard or, if you wish to implement it on your node application you can use our Slyk SDK (Node.js):
1
import slykSDK from '@slyk/slyk-sdk-node';
2
3
const slyk = slykSDK({ apikey: 'api-key' });
4
5
await slyk.wallet.create();
Copied!
You can now see that a new wallet appears on your dashboard - it should be the first one on the list. You should also see two other wallets:
  • the Default Wallet: which stores the available funds on your Slyk.
  • the Transit Wallet: which temporary stores the funds that are in transit on your Slyk.
Using the UI SDK you can display the balance of the newly created wallet:
1
// Initialize the UI SDK
2
import slykUI from 'slyk-sdk-javascript-ui';
3
4
// Get balance
5
slykUI.renderBalance(document.getElementById('balance'), {
6
assetCode: 'usd',
7
locale: 'en',
8
token: 'token'
9
});
Copied!
The token is a JWT that is signed using a widget credential. The wallet id should be stored on the data.walletId.
1
<!--Display balance in your frontend-->
2
<div id="balance"></div>
Copied!
Depending on how you style your html elements you should be able to display the balance as in the following example:
Balance being display with custom CSS
Congratulations! You have successfully created and display the balance of your first Slyk wallet!

Step 3 - Add Funds to the Wallet

Back on your dashboard, go to "Slyk Setup -> Payment Methods" and configure and enable your preferred one(s):
Payment methods for active default currency (USD)
Deposit funds via your preferred method:
1
// Initialize Slyk UI SDK
2
import slykUI from 'slyk-sdk-javascript-ui';
3
4
// Add funds
5
slykUI.renderAddFunds(document.getElementById('addFunds'), {
6
assetCode: 'usd',
7
locale: 'en',
8
token: 'token'
9
});
Copied!
1
<!--Display the add funds in your frontend-->
2
<div id="addFunds"></div>
Copied!
Check you your new balance using the UI SDK.

Step 4 - Charge for a Sale

Make a payment (to your Default Wallet):
1
// Initialize Slyk SDK
2
import slyk from 'slyk-sdk-javascript';
3
4
function pay() {
5
const wallet = slyk.getWallet('4139d8a3-4b9e-49b5-a650-df5243d1563e');
6
7
wallet.pay({ amount: '10', assetCode: 'usd' });
8
}
Copied!
1
<!--Add a button to call the pay function on your frontend-->
2
<button onclick="pay()">Pay</button>
Copied!
Congratulations! You’ve made your first transaction.
Last modified 10mo ago