If you use Flux architecture, you can store username in store and gain access to it via state. Example with redux: when logged in ,you dispatch an Action: store.dispatch({ type: 'LOGGED IN' }) in example.js to get user name: store.getState().username