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 pre-sets the crypto your user will buy. If left blank, the user will choose the asset on their own. The options are 'ETH', 'DAI' and 'USDC'.

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

userAddress

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

Example:

new RampInstantSDK({ ...rest, userAddress: '0xe2E0256d6785d49eC7BadCD1D44aDBD3F6B0Ab58' });

hostLogoUrl

An optional 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

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

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' and 'hosted-mobile'. The default is auto.

Example:

new RampInstantSDK({ ...rest, variant: 'auto' });

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