Skip to content

Docs and Types do not match #32

@bkilrain

Description

@bkilrain

Hey there - I'm in the middle of integrating the intent client in my webapp and seeing inconsistencies between the typescript definitions that come with the lib and the docs. Specifically:

  • The docs claim that the second argument to the track method is an object of properties but the types have the properties nested behind a properties key:
// docs

unify.track('event name', { path: location.pathname, foo: 'some-value', ...etc })

// types

unify.track('event name', {properties: { path: location.pathname, foo: 'some-value', ...etc } })

  • The docs claim you can add event names to clickTrackingSelectors but the types do not support this signature:
// docs

const autoTrackOptiones = {
  clickTrackingSelectors: [
    { selector: 'button#foo', eventName: 'Clicked Foo Button' },
    { selector: 'button#bar', eventName: 'Clicked Bar Button' },
  ]
}

// types only supports a signature of string[]

const autoTrackOptiones = {
  clickTrackingSelectors: [ 'button#foo',  'button#bar']
}

There are other inconsistencies as well. I don't see any changelog or release log in the repo so I can't tell if these features did exist at one time and were removed... or what.

I haven't actually run the code yet to see if the types are incorrect... I assume they are fine and the documentation is wrong. But I figured I'd drop a note to highlight the inconsistencies.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions