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. Go to your Slyk dashboard.

  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):

import slykSDK from '@slyk/slyk-sdk-node';
const slyk = slykSDK({ apikey: 'api-key' });
await slyk.wallet.create();

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:

// Initialize the UI SDK
import slykUI from 'slyk-sdk-javascript-ui';
// Get balance
slykUI.renderBalance(document.getElementById('balance'), {
assetCode: 'usd',
locale: 'en',
token: 'token'
});

The token is a JWT that is signed using a widget credential. The wallet id should be stored on the data.walletId.

<!--Display balance in your frontend-->
<div id="balance"></div>

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:

// Initialize Slyk UI SDK
import slykUI from 'slyk-sdk-javascript-ui';
// Add funds
slykUI.renderAddFunds(document.getElementById('addFunds'), {
assetCode: 'usd',
locale: 'en',
token: 'token'
});
<!--Display the add funds in your frontend-->
<div id="addFunds"></div>

Check you your new balance using the UI SDK.

Step 4 - Charge for a Sale

Make a payment (to your Default Wallet):

// Initialize Slyk SDK
import slyk from 'slyk-sdk-javascript';
function pay() {
const wallet = slyk.getWallet('4139d8a3-4b9e-49b5-a650-df5243d1563e');
wallet.pay({ amount: '10', assetCode: 'usd' });
}
<!--Add a button to call the pay function on your frontend-->
<button onclick="pay()">Pay</button>

Congratulations! You’ve made your first transaction.