Using faisalman:ua-parser-js


Before filing an issue on it’s github, can’t ua-parser-js be used on the client in Meteor? I have added 0.7.9 successfully to my app with meteor add faisalman:ua-parser-js. It seems to be exported as UAParser in package.js here, for both client and server. Still, I can’t seem to acccess it? See this MeteorPad for examples of what I’ve tried.


you can register helper, for example

Template.registerHelper('parseUA', function(ua) {
  var parser = new UAParser();

  var result = parser.getResult();

  return parser.getOS().name + ", " +

and will using in template

{{parseUA status.lastLogin.userAgent }}

for you i think ua-parser is not initialize in rendered method, use it in helpers, just

var parser = new UAParser();


Thanks. Sorry for not getting back to you on this. The problem here is deeper I think. If you see the Meteorpad. Setting breakpoints all over my app where you’d think it would be accessible (in templates, helpers, etc), (window./global.)UAParser is undefined.