Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting other segment methods #60

Open
defjosiah opened this issue May 18, 2019 · 3 comments
Open

Supporting other segment methods #60

defjosiah opened this issue May 18, 2019 · 3 comments
Labels
feature-request New feature or request

Comments

@defjosiah
Copy link

defjosiah commented May 18, 2019

feature proposal ✍️

Please detail the following items when filing a feature request:

Wanted to request that the generated Analytics object would include typed methods for more than just the "track" event.

Ideally, we'd be able to use this as a typesafe wrapper around the whole segment api.

For instance, an example usage from our codebase (simplified):

   // track is an initialized generated analytics client
    window.analytics.identify({
      'ab-test-variation': Cookies.get('ab-test-variation') || 'no-cookie',
    });
    track.variationViewed({
      'ab-test-variation': Cookies.get('ab-test-variation'),
    });

Ideally instead of "window.analytics" we could always just use a generated client with typesafe args.

In the ideal case, it would probably include a schema for the (in this instance) identify call. But even a loose typescript type like {[key: string]: any} would be nice.

Also, thanks for this library! It's fantastic, it's not that often that there is an immediate "I wish this existed", "oh my gosh it does" event.

@colinking
Copy link
Contributor

Thanks for raising this issue, @defjosiah!

Just added identify and group to the v7.x roadmap: #59 We'll probably add these as a typed .identify() and .group() call.

We'll add page and screen call support at some point in the future, it's just lower priority for us right now, since we don't yet support named page calls in the Segment Tracking Plan editor.

@defjosiah
Copy link
Author

Awesome! Thank you, that'll be great.

@colinking
Copy link
Contributor

Heads up that we just shipped v7 (you can try it out with npx typewriter init), but we cut identify/group support from scope for that release. It's still on our roadmap for a v7.x release, though.

Will leave this issue up until it's live.

@colinking colinking added the feature-request New feature or request label Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants