npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nash-io/ramp-widget-sdk

v0.4.2

Published

[![NPM](https://img.shields.io/npm/v/@nash-io/ramp-widget-sdk.svg)](https://www.npmjs.com/package/@nash-io/ramp-widget-sdk)

Downloads

807

Readme

ramp-widget-sdk

NPM

A JavaScript library to allow third-parties to include a Nash fiat ramp widget in any webpage.

Getting started

Examples

npm module

Install

# npm
npm install @nash-io/ramp-widget-sdk

# yarn
yarn add @nash-io/ramp-widget-sdk

Embed

Your page must contain an HTML element with the following data attribute: data-nash-fiat-ramp-widget:

<div data-nash-fiat-ramp-widget />

Once initializing the widget like below, an iframe pointing to the widget deployment will be loaded within your HTML element:

// import the module
import NashRamp from "@nash-io/ramp-widget-sdk";

// initialize the widget
const nashWidget = new NashRamp();

nashWidget.init({
  width: 496,
  height: 576,
});

With React

The pattern above can be reproduced in a simple React component:

import React, { useEffect } from "react";
import NashRamp from "@nash-io/ramp-widget-sdk";

const NashRampWidget = () => {
  useEffect(() => {
    const nash = new NashRamp();
    nash.init({
      width: 496,
      height: 576,
    });
  }, []);
  return <div data-nash-fiat-ramp-widget />;
};

export default NashRampWidget;

And then used anywhere:

export default () => <NashRampWidget />;

Browser (UMD module)

<!-- embed the script -->
<script
  src="https://unpkg.com/@nash-io/ramp-widget-sdk@latest/dist/ramp-widget-sdk.umd.js"
  async
></script>

<body>
  <!-- initialize -->
  <script>
    function initializeNash() {
      const nash = new NashRamp();
      nash.init({
        width: "496px",
        height: "576px",
      });
    }
    window.onload = function () {
      initializeNash();
    };
  </script>
  <!-- HTML target -->
  <div data-nash-fiat-ramp-widget />
</body>

API

new NashRamp({ ...options })

| Property | Description | Type | Required | Default | | ------------ | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------- | | base | The symbol of the fiat currency to be used in the purchase. | string | No | n/a | | env | Points to the environment where the widget is deployed. | 'LOCAL' | 'PREVIEW''PRODUCTION' | No | 'PRODUCTION' | | referrer | Your service name (used by Nash for tracking). | string | No | window.location.hostname | | target | The symbol of the crypto currency to be purchased. | string | No | n/a | | blockchain | The symbol of the network to be used. | 'BTC' | 'ETH' | 'NEO' | 'NEO3' | 'POLYGON' | 'AVAXC' | 'ARBITRUM' | No | n/a |

NashRamp.init({ ...options })

| Property | Description | Type | Required | | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ | -------- | | width | Widget width — use 100% for responsiveness | string | number | Yes | | height | Widget height — minimum 576px | string | number | Yes | | mode | Initializes the widget on Buy or Sell mode. | BUY|SELL | No | | baseAmount | Initializes the widget with a fixed base amount. | number | No | | targetAmount | Initializes the widget with a fixed target amount — will take precedence if used with baseAmount. | number | No |