npm i rc_sdk_gm
yarn add rc_sdk_gm
Documentation of Redcarpet API and their usage
Instantiate the redcarpet instance with apiKey
, productType
& productVersion
. You can obtain the keys from the redcarpet website.
const RedcarpetUpAPI = require('rc_sdk_gm');
var instance = new RedcarpetUpAPI({
productType: "your-product-type",
apiKey: "your-api-key",
});
The resources can be accessed via the instance. All the methods invocations follows the namespaced signature
// API signature
// {redcarpt Instance}.{methodName}
// example
instance.getOtp({
phone:'XXXXXXXXXX'
});
Every resource method returns a promise.
instance.verifyOtp({
phone: 'XXXXXXXXXX',
otp: '234343',
})
.then(response => {
// handle success
})
.catch(error => {
// handle error
});
MIT Licensed. See LICENSE.txt for more details