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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@onrampfunds/embed-react

v0.0.6

Published

React wrapper for @onrampfunds/embed. Placeholder release — the component lands in CTO-344.

Readme

@onrampfunds/embed-react

React wrapper for @onrampfunds/embed.

npm install @onrampfunds/embed-react

React is a peer dependency. The core library comes with it, pinned to an exact matching version — you never have to reason about which wrapper pairs with which core.

Use

import { OnrampPrequalification } from '@onrampfunds/embed-react';

export function CapitalPanel({ prequalification }) {
  return (
    <OnrampPrequalification
      {...prequalification}
      onEvent={(name, meta) => analytics.track(`onramp:${name}`, meta)}
    />
  );
}

Every prop except className and style is the core's mount config, so that package's README is the contract for amounts, copy, theme tokens, states, and events. In practice you spread the prequalification response straight in, exactly as above.

What the wrapper actually does

It is a ref and an effect. The core owns everything that carries weight — the closed shadow root, the state machine, the contrast guard, the regulated copy contract — and none of that is reimplemented here. What this package handles is reconciling an imperative mount against React's lifecycle, which has two failure modes worth naming.

An inline callback does not remount the card. This is the one that bites people:

<OnrampPrequalification {...config} onEvent={(name, meta) => track(name, meta)} />

That arrow function is a new value on every parent render. Keying the mount effect on props directly would tear down the shadow root and rebuild it every time anything in the parent changed — a visible flicker on a surface that is supposed to sit quietly in someone else's dashboard.

So the effect is keyed on a value-based signature of the config rather than its reference, and callbacks are read through a ref at call time. Two objects describing the same card leave it in place, including when only key order differs. The card always invokes your latest handler, not the one captured at mount.

Strict mode does not produce two cards. React double-invokes effects in development; the cleanup unmounts properly, so you end with exactly one shadow root.

A config change that genuinely differs — a new amount, a new expiry — does remount, which is the correct behaviour and what the core's own update() would do anyway.

States

The card renders nothing when there is no amount, and nothing when the config is malformed (the reason is logged). Both leave an empty element behind and neither throws into your tree. That is deliberate: a merchant who does not qualify this month must never see something that reads as a rejection.

If you need the imperative API

The wrapper is a convenience, not a requirement. mount() from the core is a ref and a useEffect if you would rather own the lifecycle yourself — the same two problems above are then yours to solve.

License

MIT.

Trademark. The MIT licence covers the code. It does not grant any right to use the Onramp Funds name, logo, or other trademarks, or to access the Onramp Funds API or services.