1.0.4 • Published 2 months ago

@alchemy-pay/ramp-sdk v1.0.4

Weekly downloads
-
License
-
Repository
gitlab
Last release
2 months ago

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.

1.0.2

1 year ago

1.0.1

1 year ago

1.0.4

2 months ago

1.0.0

1 year ago