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

referrd-widget-react

v1.2.14

Published

To integrate the `referrd-widget-react` package into your Next.js project, follow the steps below:

Downloads

68

Readme

Installing referrd-widget-react for Next.js

To integrate the referrd-widget-react package into your Next.js project, follow the steps below:

Step 1: Install the Package

Make sure to install the latest version of the referrd-widget-react package. Open your terminal and run the following command:

npm install referrd-widget-react@^1.2.4

Step 2: Set up the Layout

Create a file named subLayouts.js in the layouts folder of your Next.js project's root directory. Add the following content to set up the layout:

// File: layouts/subLayouts.js

'use client';

import { MainRefferalModal } from "referrd-widget-react";

export default function SubLayout({ children }) {
    return (
        <>
            <MainRefferalModal />
            <main>{children}</main>
        </>
    );
}

Step 3: Workflow of the Package

The referrd-widget-react package follows a specific flow to display the referral widget:

  1. Check for Active Campaigns:

    • The package component checks all pages to identify if a campaign is active. A campaign is considered active if a brand user has created a campaign with a given product page URL.
  2. Display Widget after Payment:

    • The widget is displayed after a successful payment. Ensure that the redirection to the product page where the campaign is active includes the parameter ?payment_success=true.
  3. Redirect to Product Page with Parameters:

    • After payment is done, redirect the user to the product page where the campaign is active.
    • Include the parameter ?payment_success=true in the URL to trigger the display of the widget.

Examples:

  • Normal URL:

    • https://weframe-shop.vercel.app/single-product/1?payment_success=true
  • Referral URL:

    • https://weframe-shop.vercel.app/single-product/1?referrd_referral=rbd1r7&referrd_uuid=0bd6ebba-bdac-4bcd-ac72-2cbeef22256f&payment_success=true

Make sure to adapt the examples based on your project's specific URLs and routing. Now, you have successfully installed and configured the referrd-widget-react package in your Next.js project.

Step 4: Technical Support

If you encounter any technical issues or have questions related to the referrd-widget-react package, please feel free to contact the system administrator or the Referrd team for assistance.

For technical support, you can reach out via email: [email protected].

They will be happy to help you with any inquiries or problems you may encounter during the integration or use of the referral widget.

Now you're all set! If you need further assistance, don't hesitate to get in touch with the support team.