ipfs / ipfs-gui

Creating standards and patterns for IPFS that are simple, accessible, reusable, and beautiful
104 stars 19 forks source link

create metrics collection/consent library for our use #129

Closed SgtPooki closed 1 year ago

SgtPooki commented 1 year ago

This library should contain the code from https://github.com/ipfs/public-gateway-checker/pull/309, in a way that can be consumed by the packages listed at https://github.com/ipfs/ipfs-gui/issues/105

We should host this library at https://github.com/ipfs-shipyard/ignite-metrics and publish to npm as @ipfs-shipyard/ignite-metrics

A few requirements for this library:

Functional requirements

  1. Code is ESM.
  2. Export ESM.
  3. Can be consumed by CJS react libraries
  4. can be consumed by ESM react libraries
  5. can be consumed by CJS non-react libraries
  6. can be consumed by ESM non-react libraries
  7. For non-react libraries, the https://github.com/ipfs-shipyard/ignite-metrics/blob/ec17cc85748319d1dfe42003feea3a76eba209cf/src/CountlyMetrics.ts file will need to be enough for consumers to consume as they will not be able to consume the react components.

Inputs

  1. countly API key and url
  2. consent warning text/component
  3. consent acceptance text/component

Exports

  1. Warning component: https://github.com/ipfs/public-gateway-checker/blob/c727202d5a98b9e191a9d979fdb4e40e8d23cf43/src/index.html#L16-L25
  2. consent component: https://github.com/ipfs/public-gateway-checker/blob/master/src/index.html#L26-L35
  3. consent toggle component: https://github.com/ipfs/public-gateway-checker/blob/c727202d5a98b9e191a9d979fdb4e40e8d23cf43/src/index.html#L69-L84
  4. Countly instance/global (this could be something else in the future)
whizzzkid commented 1 year ago

Just documenting my thoughts on the future: