npm

@mejik.dev/mg-react-analytics
TypeScript icon, indicating that this package has built-in type declarations

0.0.4-alpha • Public • Published

Microgen react analytics

N|Solid

Build Status

send analytics from client side microgen API

currently only supported with React Apllo

Setup

import { ApolloClient, InMemoryCache, HttpLink, from } from "@apollo/client";
import analytics from "@mejik.dev/mg-react-analytics";
const { slowResponseTimeLink } = analytics("your project path");

// report when there's query respone time greater than 5000 ms
const slowResponseLink = slowResponseTimeLink(5000);

const httpLink = new HttpLink({
  uri: "http://localhost:4000/graphql",
});

const client = new ApolloClient({
  link: from([slowResponseLink, httpLink]),
  cache: new InMemoryCache(),
});

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @mejik.dev/mg-react-analytics

Weekly Downloads

0

Version

0.0.4-alpha

License

ISC

Unpacked Size

10.5 kB

Total Files

6

Last publish

Collaborators

  • mejik.dev