@alchemy-pay/ramp-sdk

1.0.4 • Public • Published

Ramp SDK

A JavaScript library for decentralised applications to onboard their global user base with fiat currency.

Installation

# Using npm
$ npm install @alchemy-pay/ramp-sdk

Example usage

Refer here for the full list of customisation options

<div id="rampView" style="width: 350px;height: 700px"></div> 
import {rampSDK} from '@alchemy-pay/ramp-sdk';

// Definition Ramp SDK
let ramp = new rampSDK({
    secret: '<you-secret-key>', // (Required)
    appId: '<your-app-id>', // (Required)
    environment: '<environment: TEST/PROD>', // (Required)
    containerNode: 'rampView', // (Required) Dom node id
    optionalParameter: {
        // .....
        // Parameters Tips:(The exact name and case of the parameter must be used.)
        // For the full list of customisation options check the link above
    },
});

// Initialization Ramp SDK
ramp.init();

// The callback triggered by the return button after the order payment is successful
ramp.on('RAMP_WIDGET_CLOSE',(cb) => {
    // Destroy Ramp SDK
    ramp.close()
})
// or
ramp.on('*',(cb) => {
    // Destroy Ramp SDK
    if(cb.eventName === 'RAMP_WIDGET_CLOSE'){
        ramp.close()
    }
})

For in-depth instructions on integrating Ramp, view our complete documentation.

/@alchemy-pay/ramp-sdk/

    Package Sidebar

    Install

    npm i @alchemy-pay/ramp-sdk

    Weekly Downloads

    93

    Version

    1.0.4

    License

    none

    Unpacked Size

    286 kB

    Total Files

    3

    Last publish

    Collaborators

    • zhizi1005