mixpanel-js icon indicating copy to clipboard operation
mixpanel-js copied to clipboard

@types/mixpanel-browser does not support autocapture

Open mundanelunacy opened this issue 10 months ago • 6 comments

I try mixpanel.init() with the autocapture argument:

            mixpanel.init(MIXPANEL_TOKEN, {
                debug: MP_DEBUG,
                persistence: "localStorage",
                autocapture: true,
            });

I get the following typescript error: Object literal may only specify known properties, and 'autocapture' does not exist in type 'Partial<Config>'.

Here is my package.json

{
  "dependencies" :  {
         "mixpanel-browser": "^2.60.0",
         "@types/mixpanel-browser": "^2.51.0",
   }
}

Image

mundanelunacy avatar Feb 19 '25 07:02 mundanelunacy

We don't maintain DefinitelyTyped, you can open a PR on that repo for them to review

tdumitrescu avatar Feb 19 '25 16:02 tdumitrescu

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/72311

koooge avatar Apr 08 '25 13:04 koooge

@tdumitrescu Sadly nobody really seems to feel responsible for this package over at DefinitelyTyped. I pushed a few PRs over there already and it always took a few weeks until approval. My latest PR which would close this issue here is now open for 30 days already but nobody seems to bother looking at it. afaik people can be added as maintainers for particular packages. It would already help if someone from Mixpanel could be added to gain approval permissions. So far only DefinitelyTyped core team members have approved the changes to this package if at all.

levrik avatar Apr 28 '25 10:04 levrik

Yeah, sorry about that. We're planning to pull the typedefs into this repo soon, so the process won't be so painful.

tdumitrescu avatar Apr 28 '25 17:04 tdumitrescu

@tdumitrescu That's awesome news. I hope my PR gets merged before. Otherwise please include it when pulling in the typings 😅

levrik avatar Apr 28 '25 19:04 levrik

It's finally merged and released as 2.60.0.

levrik avatar May 05 '25 22:05 levrik