0.0.4-alpha • Published 3 years ago

@mejik.dev/mg-react-analytics v0.0.4-alpha

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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

0.0.4-alpha

3 years ago

0.0.3-alpha

3 years ago

0.0.2-alpha

3 years ago

0.0.1-alpha

3 years ago