# @fifthsage/react-amplitude

> [![Build Status](https://travis-ci.org/fifthsage/react_amplitude.svg?branch=master)](https://travis-ci.org/fifthsage/react_amplitude) [![codecov](https://codecov.io/gh/fifthsage/react_amplitude/branch/master/graph/badge.svg)](https://codecov.io/gh/fifthsa

Latest version **1.0.5** (published 2020-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @fifthsage/react-amplitude
pnpm add @fifthsage/react-amplitude
yarn add @fifthsage/react-amplitude
bun add @fifthsage/react-amplitude
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-01-02 |
| First published | 2019-09-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ohsung cho |
| Maintainers | fifthsage |

## Links

- npm: https://www.npmjs.com/package/@fifthsage/react-amplitude
- Repository: https://github.com/fifthsage/react_amplitude
- Homepage: https://github.com/fifthsage/react_amplitude#readme
- Issues: https://github.com/fifthsage/react_amplitude/issues
- npm.io page: https://npm.io/package/@fifthsage/react-amplitude

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^16.9.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.9.0
- [amplitude-js](https://npm.io/package/amplitude-js.md) ^5.3.1
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^16.9.1

## Recent versions

- 1.0.5 (latest) — 2020-01-02
- 1.0.4 — 2020-01-02
- 1.0.3 — 2019-09-30
- 1.0.2 — 2019-09-30
- 1.0.1 — 2019-09-30
- 1.0.0 — 2019-09-30

## README

# REACT AMPLITUDE

[![Build Status](https://travis-ci.org/fifthsage/react_amplitude.svg?branch=master)](https://travis-ci.org/fifthsage/react_amplitude)
[![codecov](https://codecov.io/gh/fifthsage/react_amplitude/branch/master/graph/badge.svg)](https://codecov.io/gh/fifthsage/react_amplitude)

## USAGE

### Use Context

```jsx
import { ProvideAmplitude, useAmplitude } from "@fifthsage/react_amplitude";

const App = props => {
  const amplitudeEvent = useAmplitude();

  return (
    <ProvideAmplitude apiKey={apiKey}>
      <div>
        <div>{(amplitudeEvent.event || {}).toString()}</div>
        <button
          onClick={() =>
            amplitudeEvent.logEvent("TEST_EVENT", { key: "value" })
          }
        >
          send
        </button>
      </div>
    </ProvideAmplitude>
  );
};
```

### User Consumer

```jsx
import { ProvideAmplitude, ConsumeAmplitude } from "@fifthsage/react_amplitude";

const App = props => {
  const amplitudeEvent = useAmplitude();

  return (
    <ProvideAmplitude apiKey={apiKey}>
      {({ event, logEvent }) => (
        <div>
          <div>{(event || {}).toString()}</div>
          <button onClick={() => logEvent("TEST_EVENT", { key: "value" })}>
            send
          </button>
        </div>
      )}
    </ProvideAmplitude>
  );
};
```

---
_Source: https://npm.io/package/@fifthsage/react-amplitude · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
