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

hyperplane integration #33

Open
Zolmeister opened this issue Jul 16, 2015 · 0 comments
Open

hyperplane integration #33

Zolmeister opened this issue Jul 16, 2015 · 0 comments

Comments

@Zolmeister
Copy link
Member

user model

class User
  constructor: ({@accessTokenStream, cookieSubject, @proxy}) ->
    @hyperplane = new Hyperplane {
        cookieSubject
        apiUrl: config.HYPERPLANE_API_URL
        proxy: @proxy
        joinEventFn: =>
          @getMe()
          .take(1).toPromise()
          .then ({id}) ->
            fields:
              clayId: id
      }
  getExperiments2: =>
    @hyperplane.getExperiments()
  emit: (event, opts) =>
    @getMe()
    .take(1).toPromise()
    .then (user) =>
      @hyperplane.emit event, _.merge {
        tags:
          app: config.HYPERPLANE_KEY
        fields:
          clayId: user.id
      }, opts

also emit timing events from netox

# send analytics events with timing info
netox.onTiming ({url, elapsed}) ->
  # hyperplane.emit 'timing', {fields: {url, value: elapsed}}
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

1 participant