Configuration
Ramp Network exposes multiple configuration options so that you can tailor the onramping experience to your users' needs.
Configuration
Here's a list of the available configuration parameter options.
All of our SDKs encode parameters indirectly but if you want to use the hosted mode and for example your finalUrl
contains some special characters like #
or &
then you have to encode parameters on your side before adding them to the URL. We recommend using encodeURIComponent
for this purpose.
hostLogoUrl
A required string parameter that allows you to brand your Ramp Network integration with your app's logo.
Example:
new RampInstantSDK({ ...rest, hostLogoUrl: 'https://example.com/logo.png' });
hostAppName
A required string parameter that allows you to brand your Ramp Network integration with your app's name.
Example:
new RampInstantSDK({ ...rest, hostAppName: 'Maker DAO' });
hostApiKey
A required string parameter that allows our system to properly recognize and count purchases made through your API integration. If you don't have an API key yet, you can find info on how to get one here
Example:
new RampInstantSDK({ ...rest, hostApiKey: 'the API key you received' });
swapAsset
An optional string parameter that sets a list of available crypto assets for user to choose from. If passed with a single asset, this parameter pre-sets the given asset for the user as the only option. If passed as a list (for example, swapAsset=ETH_DAI,ETH_ETH,ETH_USDC
), it sets the available assets to the user with the first asset as the default selection. If left blank, the user will choose an asset on their own from all available assets. The list of all available assets can be accessed with GET /host-api/assets
endpoint.
Additionally there is possibility to pass asset chain as a value (e.g. ETH
, FLOW
). When chain is passed it needs to to be suffixed with _*
(e.g. ETH_*
, FLOW_*
). All symbols for provided chain will be parsed automatically (e.g ETH_*
will be parsed as ETH_DAI,ETH_USDC,ETH_USDS,ETH_USDT
). Chains and symbols could be mixed (e.g. MATIC_*,ETH_ETH
). When providing only asset chain as argument, its assets could be used in defaultAsset
param (e.g. swapAsset=ETH_*&defaultAsset=ETH_DAI
).
Example:
new RampInstantSDK({ ...rest, swapAsset: 'ETH_ETH' });
offrampAsset
An optional string parameter, works exactly the same as swapAsset but applies only for off-ramp.
Example:
new RampInstantSDK({ ...rest, offrampAsset: 'ETH_ETH' });
swapAmount
An optional int parameter that pre-sets the amount of crypto your user will buy. If left blank, the user will choose the amount on their own.
Note: the amount should be provided in wei or token units.
Example:
new RampInstantSDK({ ...rest, swapAmount: 10000000000000 });
fiatCurrency and fiatValue
fiatCurrency
(string) and fiatValue
(float) are two optional parameters that allow you to pre-set the total fiat value and currency of the purchase that will be suggested to the user.
fiatCurrency
can be used as a standalone parameter or together with fiatValue
. Using fiatValue
without fiatCurrency
is not supported.
Passing fiatCurrency
alone pre-sets the currency on the widget but if the given currency is not supported in the user's country there is a fallback to the country's default currency.
Passing both parameters together additionally pre-sets the total fiat value of the transaction. If the provided currency is not available for the payment method chosen by the user, we will recalculate the purchase amount into the user-selected fiat currency.
Example:
new RampInstantSDK({ ...rest, fiatCurrency: 'GBP', fiatValue: 10.0 });
enabledFlows
An optional array of strings parameter that selects which modes are available on the widget. Acceptable values ONRAMP
- for buying crypto, OFFRAMP
- for selling crypto. If defaultFlow
is not provided first item from the array is treated as defaultFlow
. For the hosted mode value should be passed as comma separated string e.g. ONRAMP,OFFRAMP
.
Default value ['ONRAMP']
.
Example:
new RampInstantSDK({ ...rest, enabledFlows: ['ONRAMP', 'OFFRAMP'] });
defaultFlow
An optional string parameter that selects default mode of the widget. Acceptable values ONRAMP
- for buying crypto, OFFRAMP
- for selling crypto.
Default value ONRAMP
Example:
new RampInstantSDK({ ...rest, defaultFlow: 'ONRAMP' });
userAddress
An optional string parameter that pre-sets the address the crypto will be sent to. For off-ramp, will be treated as a source address from which the crypto will be sent from.
Example:
new RampInstantSDK({ ...rest, userAddress: 'user blockchain address' });
userEmailAddress
An optional string parameter that pre-fills the email address for your user to make their onramping experience even quicker.
Example:
new RampInstantSDK({ ...rest, userEmailAddress: 'test@example.com' });
selectedCountryCode
An optional string parameter that pre-selects user country. The value should be a two-letter country code (ISO 3166-1 alpha-2). Note: If a user already has used Ramp Network, their country will be selected automatically based on their last used methods.
Example:
new RampInstantSDK({ ...rest, selectedCountryCode: 'US' });
defaultAsset
An optional string parameter that pre-selects an asset that will be shown to the user when they visit Ramp Network. The user will be able to change the selected asset.
Example:
new RampInstantSDK({ ...rest, defaultAsset: 'BTC_BTC' });
url
An optional string parameter that allows you to use a non-production version of our widget.
Example:
new RampInstantSDK({
...rest,
url: 'https://app.demo.ramp.network',
});
webhookStatusUrl
An optional string parameter that allows you to subscribe to purchase events via webhooks.
Example:
new RampInstantSDK({
...rest,
webhookStatusUrl: 'https://example.com/webhook/',
});
offrampWebhookV3Url
An optional string parameter that allows you to subscribe to sale events via webhooks.
Example:
new RampInstantSDK({ ...rest, offrampWebhookV3Url: 'https://example.com/webhook/' });
finalUrl
An optional string parameter that allows you to provide a link the user will be redirected to after completing the flow.
NOTE: this is only available for the hosted integration and on-ramp flow.
Example:
new RampInstantSDK({ ...rest, finalUrl: 'https://example.com/redirect' });
useSendCryptoCallback
Only applicable for OFFRAMP
mode. An optional boolean parameter to inform the widget that Send with your wallet
button should be visible.
More details about this feature can be found here.
Example:
new RampInstantSDK({
...rest,
defaultMode: 'OFFRAMP',
useSendCryptoCallback: true,
});
variant
An optional string parameter that determines how the widget is displayed. The options are auto
, hosted
, desktop
, mobile
, hosted-mobile
, webview-desktop
, webview-mobile
, embedded-mobile
and embedded-desktop
. The default is auto
. embedded-mobile
and embedded-desktop
must be passed along with the containerNode
variable.
Example:
new RampInstantSDK({ ...rest, variant: 'auto' });
paymentMethodType
An optional string parameter that pre-selects payment method for your user to make their onramping experience even quicker. The options are SEPA
, CARD
, APPLEPAY
, GOOGLEPAY
, PISP
, PIX
.
Applies only for on-ramp.
Example:
new RampInstantSDK({ ...rest, paymentMethodType: 'CARD' });
containerNode
An DOM node parameter that must be provided when using the embedded-mobile
or embedded-desktop
variants.
Example:
new RampInstantSDK({
...rest,
containerNode: document.getElementById('ramp-container'),
});
hideExitButton
An optional boolean parameter to show or hide internal exit button on widget. Useful if you want to close the widget on your own.
Example:
new RampInstantSDK({
...rest,
hideExitButton: true,
});