Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@onramper/widget

Package Overview
Dependencies
Maintainers
6
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onramper/widget

Onramper allows your users to buy cryptocurrency with fiat, directly from your website or app.

  • 2.2.29
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

Onramper widget

Onramper allows your users to buy cryptocurrency with fiat, directly from your website or app.

For docs and examples visit: docs.onramper.com

Installation
# Using yarn
$ yarn add @onramper/widget

# Using npm
$ npm install @onramper/widget
Code snippet
import OnramperWidget from "@onramper/widget";

export default function OnramperWidgetContainer() {
  return (
    <div style={{maxWidth: '482px',  maxHeight: '660px',  height: '100%',  width: '100%'}}>
      <OnramperWidget
        color="#0316C1"
        defaultAmount={200}
        defaultCrypto="BTC"
        API_KEY="pk_live_YOUR-API-KEY"
      />
    </div>
  )
}
Live example & customization

While importing the widget as a React component, you can customize it using the component props below. CodeSandbox

Component props
NameTypeExampleDefault value
defaultCryptoString?"ETH"undefined
defaultAmountNumber?500100
defaultAddrsObject?{"BTC":["ADDR1"], "ETH":["ADDR2"]}{}
onlyCryptosString[]?["BTC", "ETH", "NEO"]undefined
excludeCryptosString[]?["ETH", "NEO"]undefined
onlyGatewaysString[]?["Moonpay", "Wyre"]undefined
colorString?"#000000""#31a5ff"
API_KEYString"pk_live_YOUR-API-KEY"-
selectGatewayByString"performance""price"

Customize

You can pass the following arguments to customize the widget

ParameterDescription
defaultCryptoSelect a specific cryptocurrency by default. Should be specified the cryptocurrency code.
defaultAmountPositive integer representing the base amount of fiat to be filled in the widget. Should be indicated in USD, for other currencies, a rounded aproximated conversion will be automatically applied.
addressesA stringified JSON with the wallet addresses of the user. The keys should be the cryptocurrency code and the value a list containing the user addresses. Can be more than one address per wallet and more than one cryptocurrency.
onlyCryptosA comma-separated list of crypto codes to include. Only this cryptos will be shown to the user.
excludeCryptosA comma-separated list of crypto codes to exclude. This cryptos will be excluded from the list of available cryptos..
onlyGatewaysA comma-separated list of gateways to enable. Only these gateways will be shown to the user for selection.
colorColor to change the highlight of the widget. Should be an hex color.

Keywords

FAQs

Package last updated on 22 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc