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

Support for Browserify #2

Closed
slorber opened this issue Feb 20, 2015 · 7 comments
Closed

Support for Browserify #2

slorber opened this issue Feb 20, 2015 · 7 comments

Comments

@slorber
Copy link

slorber commented Feb 20, 2015

Please export the TrackJS npm published module so that we can require it.

The following code should be supported:

var TrackJs = require("trackjs");

TrackJs.configure({
        token: "token"
});

TrackJs.track("test")

Unfortunately TrackJS module on NPM seems to not export its content and use a trackJs global variable, and also seems to require the token to be configured before lib loading, making call to configure with a token useless according to this warning
TrackJS could not find a token

@marcbachmann
Copy link

👍

@toddhgardner
Copy link
Member

Will investigate what this will take.

@karellm
Copy link

karellm commented Jul 20, 2015

👍 It took me a while to figure it out.

The documentation states we can use _trackJs or trackJs.configure() but it is not the case. So we need to rely on hack to inject _trackJs prior the script loads which is far from ideal!

@don-smith
Copy link

👍 A common practice is to NOT check things like tokens into source control. We use a local config service (Angular) to bring in these tokens. I'm still trying to figure out how to do this for TrackJS. Far from ideal indeed!

@toddhgardner
Copy link
Member

This is on our backlog and we're prioritizing it with other work. I'll update here when we have a timetable.

@jherdman
Copy link

To add to this ticket, it'd be great if the bower package exported an AMD module. This would make an entire part of my ember-cli-trackjs package obsolete.

@toddhgardner
Copy link
Member

This has been added in agent v3.0.0, currently in canary testing. You can reference it as a module from npm:

npm install trackjs@canary

import { TrackJS } from 'trackjs';
TrackJS.install({ token: 'YOUR_TOKEN' });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants