Woopra / node-woopra

nodejs library for Woopra
MIT License
4 stars 4 forks source link

Adding TypeScript declarations file. #5

Closed joelday closed 7 years ago

joelday commented 7 years ago

Thanks!

joelday commented 7 years ago

@philosoralphter Which properties on the ClientData interface are optional? Also, are additional developer-defined properties allowed? Thanks!

Additionally, if you do not want the maintenance burden of having this in the repo, it can be in DefinitelyTyped and published on NPM as @types/node-woopra instead.

philosoralphter commented 7 years ago

@joelday Can you clarify your question on the ClientData interface? I'm not sure to what you are referring. The woopra.client() method here? I believe you can send custom properties in addition to the documented expected values in that object as well (all are optional, but may be filled in automatically with your server's information if you do not pass in e.g. the ip of the client). Let me double check on that.

philosoralphter commented 7 years ago

@joelday: I have never used typescript in a node package. Can you tell me how this would affect users who do not use typescript? As far as I know, this will only allow users to utilize typescript, but will not enforce it or affect others in any way.

Can you confirm this?

philosoralphter commented 7 years ago

@joelday So I see what you're talking about with your ClientData interface. The whole method/interface is different from the event properties in that when sent to woopra they are not prefixed with cv_ or ce_ See our http api docs for more info on this. But what this means is that the fields in the client are specially recognized by the system, and while you might send other ones, the system may drop them as they are not expected and not custom event nor custom visitor properties.

Looks to me like this is a fine addition to the library. Since the ClientData interface is not flexible, I will go ahead and merge this and bump the package version.

Thanks

joelday commented 7 years ago

@philosoralphter Thanks a ton! Let me know if you need anything else. If any issues come along, just give me a mention. :)