A JavaScript library for decentralised applications to onboard their global user base with fiat currency.
# Using npm
$ npm install @alchemy-pay/ramp-sdk
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.