Q:

Elegant solution to access the navigator object from isomorphic application?

I'm working on a video live-streaming project to explore the depths of HTML5 video and binary streaming. Simply someone can use their webcam via the JavaScript UserMedia API and someone else can connect to their room and watch them. It's built on React and NodeJS.
I planned to build this application isomorphically to again explore the depths of a new element of the field.
I quickly kicked myself when I realised I couldn't access the CLIENT-SIDE JavaScript navigator object as the application is not executed within the browser context. doh.
My solution is to force the streaming user to download a single React component file to be executed in the browser context. This however doesn't seem too elegant as it means I have to break the isomorphic pattern quite heavily and have to introduce a public-facing API for the streaming functionality. It also means React is split between 2 instances that cannot communicate with each other as far as I know (but I believe I may learn this to be false)
TLDR; Could anyone direct me to a possible elegant solution to access the client-side navigator API from a nodeJS isomorphic React application?

A:

You won't be able to use navigator API in NodeJS since it's only implemented in browser. If you're trying to find a good solution to avoid execution errors on server then you can check if typeof window !== undefined and the use navigator if window is present. Also you can put  code with navigator part in componentDidMount() function in React component (if it's a component-related code) – it's executed only on the client side.

