Reputation: 31
Can anybody help me to get current logged in user's details(at-least email) from Grafana dashboard. I am creating custom panel plugin in Grafana and required the user details. Please help!
Upvotes: 1
Views: 1579
Reputation: 88
You can get it from the grafana runtime lib.
import { config } from '@grafana/runtime';
console.log(config.bootData.user);
Upvotes: 1
Reputation: 31
I found the solution, this may help someone else. You just need to import config from app/core and you will get user details under
config.bootData.user
like this:
import config from '../../../../public/app/core/config';
interface Props extends PanelProps<SimpleOptions> {}
console.log(config.bootData.user)
Upvotes: 0