 
   @tokens = ['zooHome', 'zooTalk', 'zooniverse/gravity-spy']
 
-  keys: {}
+  keys: 
+    projectToken: 'zooHome'
 
   geordi: null
 

            data: "\"#{eventData}\""

  logEvent: (logEntry) -> # Accepts key/values to make appropriate Geordi logging
    geordi = @instance()
    newEntry = Object.assign {}, logEntry, @keys
    if GeordiLogger.tokens.indexOf(newEntry.projectToken) > -1
      @geordi?.logEvent newEntry
    console.log 'No logger available for event ', JSON.stringify(logEntry) unless @geordi?.logEvent

  remember: (keyVals) ->
    rebuild = keyVals?.projectToken? && (keyVals?.projectToken != @geordi?.projectToken)
    @geordi = @makeGeordi keyVals.projectToken if rebuild
    @keys = Object.assign {}, @keys, keyVals

  forget: (forgetKeys) ->
    rebuild = false
    for key in forgetKeys
      rebuild = true if key == 'projectToken'
      delete @keys[key]

    @geordi = @makeGeordi '' if rebuild

module.exports = React.createClass
  displayName: 'PanoptesApp'


  makeGeordi: (projectSlug) ->
    new GeordiClient
      env: @state?.env
      projectToken: projectSlug || @keys?.projectToken
      zooUserIDGetter: () => @state.user?.id
      subjectGetter: () => @keys?.subjectID

