Get authenticated user name in grafana app

I’m developing a grafana app and withing the app I would like to get the authenticated user name.

Please let me know how I can achieve this?

import { contextSrv } from 'app/core/core'; 

console.log(contextSrv.user);