remix-fathom
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

remix-fathom

This package exports the following hooks:

  • useFathom(id, opts)
  • useGoal(code, cents)

Setup

npm install remix-fathom fathom-client

fathom-client is a peer dependency.

Then in app/root.tsx, add

import { useFathom } from "remix-fathom";

useFathom("YOUR_SITE_ID", myOpts);

useFathom

Supply your Fathom site ID and optional opts object to configure fathom-client. While fathom-client is a peer dependency, the useFathom hook will set up loading and registering your tracked views each time the page changes.

useGoal

This hook returns you a memoized function pre-populated with your provided code and cents.


Thanks to Sergio Xalambrí for the inspiration!

/remix-fathom/

    Package Sidebar

    Install

    npm i remix-fathom

    Weekly Downloads

    1

    Version

    0.0.9

    License

    MIT

    Unpacked Size

    3.92 kB

    Total Files

    4

    Last publish

    Collaborators

    • brandonpittman