Configuration

Ramp Instant 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.

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=DAI,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.

Example:

new RampInstantSDK({ ...rest, swapAsset: '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 (int) are two optional parameters that allow you to pre-set the total fiat value of the purchase that will be suggested to the user. They have to be used together as they don't work separately.

Note: This only sets the total fiat value of the transaction - actual currency used will depend on user's country and payment method.

Example:

new RampInstantSDK({ ...rest, fiatCurrency: 'GBP', fiatValue: 10 });

userAddress

An optional string parameter that pre-sets the address the crypto will be sent to.

Example:

new RampInstantSDK({ ...rest, userAddress: 'user blockchain address' });

hostLogoUrl

A required string parameter that allows you to brand your Ramp Instant 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 Instant integration with your app's name.

Example:

new RampInstantSDK({ ...rest, hostAppName: 'Maker DAO' });

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, 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. \ The user will be able to change the selected asset.

Example:

new RampInstantSDK({ ...rest, defaultAsset: 'BTC' });

url

An optional string parameter that allows you to use a non-production version of our widget.

Example:

new RampInstantSDK({ ...rest, url: 'https://ri-widget-staging.firebaseapp.com' });

webhookStatusUrl

An optional string parameter that allows you to subscribe to events via webhooks.

Example:

new RampInstantSDK({ ...rest, webhookStatusUrl: '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.

Example:

new RampInstantSDK({ ...rest, finalUrl: 'https://example.com/redirect' });

variant

An optional string parameter that determines how the widget is displayed. The options are 'auto', 'hosted', 'desktop', 'mobile', 'hosted-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' });

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') });

hostApiKey

An optional string parameter that allows our system to properly recognize and count purchases made through your API integration.

Example:

new RampInstantSDK({ ...rest, hostApiKey: 'the API key you received' });