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

@reeelit/integration-react

v2.0.0

Published

## Step 1: Install from NPM

Downloads

3

Readme

Installation

Step 1: Install from NPM

npm install --save @reeelit/integration-react

or

yarn add @reeelit/integration-react

Step 2: Add iFrame script

Copy-paste the following snippet into the <head> of each page you plan to use the integrated Reel checkout.

In your test environment:

<script src="https://checkout.reelit.ninja/v2/reel.js"></script>

In your production environment:

<script src="https://checkout.joinreel.co/v2/reel.js"></script>

Step 3: Initialize

After the script from Step 2 is loaded, call reel.initialize(<partnerId>).

Step 4: Add to app

Use the ReelYoursIn component on your product detail pages to allow users to begin saving with Reel.

import { ReelYoursIn } from '@reeelit/integration-react';

const ProductDetailPage = (props) => {
  return (
    <ReelYoursIn
      className="reel-yours-in"
      variant="yours-by"
      productConfig={
        [
          {
            product: {
              title: 'iPhone 12 - 64GB',
              description: 'The newest iPhone on the market, now with... improvements!',
              brand: 'Apple',
              retailer: 'Best Buy',
              image: 'https://rb.gy/hgfrmn',
              colorOptions: ['White', 'Rose Gold', 'Black'],
              sizeOptions: [],
            },
            price={100000}
            color="Rose Gold",
            size={undefined},
            url={window.location.href}
          }
        ]
      }
      htmlTag="p"
      onComplete={(body) => {
        alert('User completed checkout!');
      }}
      onDropOff={(body) => {
        alert('User dropped off checkout!');
      }}
    />
  );
};

ReelYoursIn component props

  • className: string? - Use this to customize the styling of the ingress text.
  • variant: enum? - The ingress text to render. See Variants section for details.
  • productConfig: object[] - An array representing one or more products and a user's selected variants.
    • product: object - An object representing a single product.
      • title: string - The name of the product for display.
      • description: string - A description of the product.
      • brand: string - The brand of the product.
      • image: string - The URL of the primary product image.
      • colorOptions: string[] - An array of all color options for the product.
      • sizeOptions: string[] - An array of all size options for the product.
      • retailer: string - The retailer selling the product.
    • color: string? - The color the user selected. Must be present within colorOptions or undefined.
    • size: string? - The size the user selected. Must be present within sizeOptions or undefined.
    • price: number - The base price of the product in cents.
    • url: string - The product detail page URL for a product on your website.
  • htmlTag: JSX.IntrinsicElement? - The html tag to render the ingress text inside of. If not provided, defaults to span.
  • onComplete: func? - A function that's called when the user successfully starts a Reel for the product.
  • onDropOff: func? - A function that's called when the user drops off checkout.

Variants

We've provided multiple options for the copy displayed when the ReelYoursIn component is rendered, depending on the value you pass to the variant prop:

  • "save-to-buy": Save to Buy it, debt-free: Create a savings plan with Reel. Start saving now
  • "own-it": Own it, debt-free! Start a savings plan with Reel
  • "yours-by": Save $X/day, yours calculated savings completion date with Reel. Learn How

This variant is optional but recommended. If you choose not to use one of these options, you must reach out to us and request approval. To customize the ingress text, simply do not pass a variant, and pass a function as the child of the ReelYoursIn component as in the following example:

import { ReelYoursIn } from '@reeelit/integration-react';

const ProductDetailPage = (props) => {
  return (
    <ReelYoursIn ...>
      {({ showCheckout }) => <span onClick={() => showCheckout()}>Click me!</span>}
    </ReelYoursIn>
  );
};