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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@charitips/embed-react

v1.4.0

Published

This library allows you to integrate Charitips' widgets in your react web application.

Readme

@charitips/embed-react

This library allows you to integrate Charitips' widgets in your react web application.

For more instructions on how to use the Charitips API, checkout the developers documentation at https://developers.sandbox.charitips.com.

You can find an integration example at https://github.com/charitips/demos.

More configuration options are available and can be found in the documentation.

Install

yarn add @charitips/embed-react

Setup

First, you'll need to add the CharitipsProvider to your app root :

import { CharitipsProvider } from '@charitips/embed-react';

export function App() {
  // your code...
  return (
    <CharitipsProvider
      baseUrl="https://embed.charitips.com" // https://embed.sandbox.charitips.com for the sandbox environment
    >
      {/* the rest of your providers */}
    </CharitipsProvider>
  )
}

Usage

Charitips offer two types of widgets:

  • user widgets intended to be used by your end users and integrated in your application or website.
  • admin widgets intended to be used by your b2b customers if revelant, by you or by your ops team. They can be integrated in your back office or in the admin dashboard you provide to your customers. Admin widgets require authentication. Learn more in the documentation

User widgets

  • The CharitySelectionWidget to let a user choose which charity they wish to support
import { CharitySelectionWidget } from '@charitips/embed-react';

function CharitySelectionScreen({ publicKey }:{ publicKey: string }) {
  const onCharitySelected = useCallback(async ({ charityId, amount }) => {
    // Call your back-end to create a donation
    const { donationId } = await callBackEnd({ charityId, amount })
    return {
      donationId,
    };
  }, []);
  const onCloseSuccess = useCallback(() => {
    // Close screen
  }, []);
  return (
    <CharitySelectionWidget
      publicKey={publicKey}
      type="charity_and_amount_selection"
      size="fitContent"
      onCharitySelected={onCharitySelected}
      onCloseSuccess={onCloseSuccess}
    />
  );
}
  • The B2CPaymentWidget to collect donations from your users
import { B2CPaymentWidget } from '@charitips/embed-react';

function DonationScreen({ charityId, publicKey }: { charityId:string; publicKey: string  }) {
  const onSuccess = useCallback((payload: {
    donationId: string,
    charityId: string,
    amount: number,
  }) => {
    // Callback triggered when the payment is successful
    // You can use this callback for example to link the created donation with your customer.
    // You can also linked the created donation & donor with your customer by updating the externalId/uniqueExternalId property on either the donation or the donor.
    // For other use cases, listening for the donation_create &  webhooks are recommended.
  }, []);
  return (
    <B2CPaymentWidget
      publicKey={publicKey}
      size="fitContent"
      charityId={charityId}
      onSuccess={onSuccess}
    />
  );
}

Admin widgets

  • The AdminCharitiesSelectionWidget to let an admin configure the list of charities shown to the users for a given campaign
import { AdminCharitiesSelectionWidget } from '@charitips/embed-react';

function AdminScreen({ token, campaignId }: { token: string; campaignId: string }) {
  return (
    <AdminCharitiesSelectionWidget
      token={token}
      campaignId={campaignId}
      size="fitContent"
    />
  );
}
  • The AdminCampaignMetricsWidget to monitor all metrics related to a given campaign
import { AdminCampaignMetricsWidget } from '@charitips/embed-react';

function AdminScreen({ token, campaignId }: { token: string; campaignId: string }) {
  return (
    <AdminCampaignMetricsWidget
      token={token}
      campaignId={campaignId}
      size="fitContent"
    />
  );
}
  • The AdminGlobalMetricsWidget to monitor aggregated metrics across all campaigns
import { AdminCampaignMetricsWidget } from '@charitips/embed-react';

function AdminScreen({ token, campaignId }: { token: string; campaignId: string }) {
  return (
    <AdminGlobalMetricsWidget
      token={token}
      size="fitContent"
    />
  );
}
  • The AdminFiscalReceiptsWidget to view and download generated fiscal receipts
import { AdminFiscalReceiptsWidget } from '@charitips/embed-react';

function AdminScreen({ token }: { token: string }) {
  return (
    <AdminFiscalReceiptsWidget
      token={token}
      size="fitContent"
    />
  );
}