> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# selectCurrentUser

- Package: [@gooddata/sdk-ui-dashboard](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/index.md)
- Kind: variable
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-dashboard/src/model/store/user/userSelectors.ts

This selector returns current logged in user.

**Signature:**

```typescript
selectCurrentUser: DashboardSelector<IUser>
```

## Remarks

It is expected that the selector is called only after the permission state is correctly initialized. Invocations before initialization lead to invariant errors.

## Example

- on how to use `selectCurrentUser` selector within a Dashboard Plugin.

```tsx
// create the component using current user selector
const Greetings = () => {
     // read the currently logged in user information
     const user = useDashboardSelector(selectCurrentUser);

     return <div>Hello, {user.fullName}</div>;
}

// in a plugin's register function just use the component as a custom widget type
customize.customWidgets().addCustomWidget("greetingsWidget", Greetings);

 customize.layout().customizeFluidLayout((_layout, customizer) => {
         customizer.addSection(
             0,
             newDashboardSection(
                 "Greetings by Plugin",
                 newDashboardItem(newCustomWidget("greetings", "greetingsWidget"), {
                     xl: {
                         // all 12 columns of the grid will be 'allocated' for this new item
                         gridWidth: 12,
                         // minimum height since the custom widget now has just some one-liner text
                         gridHeight: 1,
                     },
                 }),
             ),
         );
     });

```
