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

react-amplitude-provider

v1.0.7

Published

Amplitude analytics integration for React applications

Readme

react-amplitude-provider

npm version npm downloads License: MIT codecov Test

English | 한국어

English

React Amplitude Provider

A lightweight React provider for Amplitude Analytics with TypeScript support.

Installation

npm install react-amplitude-provider

or

yarn add react-amplitude-provider

Features

  • 🚀 Easy integration with Amplitude Analytics
  • 📊 Built-in tracking functions for common events
  • 🔒 TypeScript support
  • 🎯 Session replay support
  • 💡 Customizable tracking options
  • ⚡️ Supports Next.js

Next.js Usage

import { AmplitudeProvider } from 'react-amplitude-provider/next'

-> Add /next in import path

React Usage

  1. Wrap your app with AmplitudeProvider:
import { AmplitudeProvider } from 'react-amplitude-provider'

function App() {
  return (
    <AmplitudeProvider
      apiKey='YOUR_AMPLITUDE_API_KEY'
      isTrackingEnabled={true} // optional, defaults to true
    >
      <YourApp />
    </AmplitudeProvider>
  )
}
  1. Use the tracking hooks in your components:
import { useAmplitude } from 'react-amplitude-provider'

function YourComponent() {
  const {
    trackEvent,
    trackPageView,
    trackFormSubmit,
    trackModalView,
    trackDownload,
    trackShare,
    trackFilter,
    updateUserProperties,
    trackLogout,
  } = useAmplitude()

  // Track a simple event
  trackEvent('button_click', { button_name: 'submit' })

  // Track page view
  trackPageView('home_page', { source: 'direct' })

  // Track form submission
  trackFormSubmit('signup_form', { email: '[email protected]' })

  return <div>Your component content</div>
}

Available Tracking Methods

  • trackEvent(eventName: string, properties?: Properties)
  • trackPageView(pageName: string, properties?: Properties)
  • trackFormSubmit(formName: string, formValues: FormValues, properties?: Properties)
  • trackModalView(modalProperties: ModalProperties, properties?: Properties)
  • trackDownload(downloadProperties: DownloadProperties, properties?: Properties)
  • trackShare(shareProperties: ShareProperties, properties?: Properties)
  • trackFilter(filterName: string, filterValues: FilterValues, properties?: Properties)
  • updateUserProperties(properties: Properties)
  • trackLogout()
  • setUserId(userId: string)
  • resetSession()

License

MIT


Korean

React Amplitude Provider

TypeScript를 지원하는 Amplitude Analytics용 React 프로바이더입니다.

설치

npm install react-amplitude-provider

or

yarn add react-amplitude-provider

기능

주요 기능

  • 🚀 Amplitude Analytics와 쉬운 연동
  • 📊 일반적인 이벤트를 위한 내장 트래킹 함수
  • 🔒 TypeScript 지원
  • 🎯 세션 리플레이 지원
  • 💡 커스터마이징 가능한 트래킹 옵션
  • ⚡️ Next.js 지원

Next.js에서 사용법

import { AmplitudeProvider } from 'react-amplitude-provider/next'

-> import path에 /next를 붙입니다.

React에서 사용법

  1. AmplitudeProvider로 앱 감싸기:
import { AmplitudeProvider } from 'react-amplitude-provider'

function App() {
  return (
    <AmplitudeProvider
      apiKey='YOUR_AMPLITUDE_API_KEY'
      isTrackingEnabled={true} // optional, defaults to true
    >
      <YourApp />
    </AmplitudeProvider>
  )
}
  1. 컴포넌트에서 트래킹 훅 사용하기:
import { useAmplitude } from 'react-amplitude-provider'

function YourComponent() {
  const {
    trackEvent,
    trackPageView,
    trackFormSubmit,
    trackModalView,
    trackDownload,
    trackShare,
    trackFilter,
    updateUserProperties,
    trackLogout,
  } = useAmplitude()

  // 간단한 이벤트 추적
  trackEvent('button_click', { button_name: 'submit' })

  // 페이지 뷰 추적
  trackPageView('home_page', { source: 'direct' })
}

사용 가능한 트래킹 메소드

  • trackEvent(eventName: string, properties?: Properties) - 일반 이벤트 트래킹
  • trackPageView(pageName: string, properties?: Properties) - 페이지 뷰 트래킹
  • trackFormSubmit(formName: string, formValues: FormValues, properties?: Properties) - 폼 제출 트래킹
  • trackModalView(modalProperties: ModalProperties, properties?: Properties) - 모달 뷰 트래킹
  • trackDownload(downloadProperties: DownloadProperties, properties?: Properties) - 다운로드 트래킹
  • trackShare(shareProperties: ShareProperties, properties?: Properties) - 공유 트래킹
  • trackFilter(filterName: string, filterValues: FilterValues, properties?: Properties) - 필터 사용 트래킹
  • updateUserProperties(properties: Properties) - 사용자 속성 업데이트
  • trackLogout() - 로그아웃 트래킹
  • setUserId(userId: string) - 사용자 ID 설정
  • resetSession() - 세션 초기화

라이선스

MIT