Coder Social home page Coder Social logo

telemetry's Introduction

Telemetry package

It is not published as an npm package yet.

First run this in the cli:

npm link telemetry

To import in your repository:

const telemetryClient = require('telemetry')

Then use it where desired like this:

 telemetryClient({
      event: trackingEvent,
      userId: currentSanityUser,
      telemetryDisabled: isTelemetryDisabled,
      metadata: {
        ... 
      },
    })

As discussed earlier - the userID should just be sent once when the user logs in, and not for every call to the telemetry package. Ideally, the disableTelemetry should also just be sent once at the same time. One way of checking if the user has disabled telemetry could be something like this:

  const disabledTelemetry: boolean =
    process.env.SANITY_STUDIO_TELEMETRY === '1' || config.telemetry_disabled

This way, the user can either disable telemetry with an env var or per studio in the sanity.json as a config variable.

Notes on current state:

The CLI needs of the telemetry are different than the studio (using require vs import) and as of right now we have something working for the cli and studio but the codes are slightly different, they would need to be bundled and built so that we can have it work on both use cases (I think).

Branch for CLI: add-timer-cli

Branch for Studio: add-timer-studio

telemetry's People

Contributors

ninaandal avatar ritadias avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.