Gluwa SDK for JavaScript (Node.js)

If your service is developed in Node.js, the features we provide are available through the SDK. The Gluwa SDK for Node.js is a library with powerful features that enable Node.js developers to easily make requests to the Gluwa APIs.

Getting started

Install the npm package on your Node.js server.

$ npm install @gluwa/gluwa-js
circle-exclamation

Create and initialize a Gluwa object. Then, enter the APIKey, APISecret and WebookSecret generated from the Gluwa Dashboardarrow-up-right, and an Ethereum wallet to manage your funds. Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.

const GluwaJS = require('@gluwa/gluwa-js');

const GluwaConfig = {
    production: {
        APIKey: '{Your production API Key}',
        APISecret: '{Your production API Secret}',
        WebhookSecret: '{Your production Webhhok Secret}',
        MasterEthereumAddress: '{Your Ethereum Address for production}',
        MasterEthereumPrivateKey: '{Your Ethereum Private Key for production}',
        isDev: false,
    },
    sandbox: {
        APIKey: '{Your sandbox API Key}',
        APISecret: '{Your sandbox API Secret}',
        WebhookSecret: '{Your sandbox Webhhok Secret}',
        MasterEthereumAddress: '{Your Ethereum Address for sandbox}',
        MasterEthereumPrivateKey: '{Your Ethereum Private Key for sandbox}',
        isDev: true,
    },
}

const Gluwa = new GluwaJS(GluwaConfig.production);

Now you are ready to use the Gluwa API.

Method Examples

getPaymentQRCode API returns a QR code png image as a Base64 string. You can display the image on your website as below:

When user completes transfer via the QR code, the Gluwa API sends a webhook to your webhook endpoint. Verify that the values ​​actually sent by the Gluwa server are correct.

Verify the requested Signature and Payload as follows:

How to resolve promise

All functions except Webhook Validation return promise. This can be used by resolving it like this:

Last updated

Was this helpful?