{"repo":"koblas/react-amplitude-hooks","free":true,"listed":false,"github":"https://github.com/koblas/react-amplitude-hooks","clone":"git clone https://github.com/koblas/react-amplitude-hooks.git","description":"Amplitude React components supporting hooks","language":"TypeScript","stars":27,"topics":["react","amplitude","analytics","typescript"],"license":"MIT","category":"analytics","readme_excerpt":"react-amplitude-hooks A React component library for easy product analytics instrumentation. Improvement from the @amplitude/react-amplitude library This library is designed to be fully API compatible with the @amplitude/react-amplitude library, but taking advantage of the modern React features of hooks and context API. - Hook support const { instrument, logEvent } = useAmplitude(); - TypeScript support Example: Instrumenting Tic-Tac-Toe (From Facebook's Intro to React Tutorial) This is a hooks re-write of the example for demonstration purposes. Events logged: - start game - game won - click square - jump to move - go to game start Event properties: - scope (array; \"square\", \"history\", \"game\") - moves made (number) - winner (\"X\" or \"O\") - current player (\"X\" or \"O\") Installation With npm: With yarn: react-amplitude-hooks does not come with its own copy of the Amplitude JavaScript SDK. You can either install the Amplitude SDK via npm or with a JavaScript snippet. API Documentation useAmplitude(eventProperties?: object, instanceName?: string) Argument Description --------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------","default_branch":null,"files":null,"tree":[],"storefront":"/r/koblas","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/koblas/react-amplitude-hooks/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}