The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
import type { MetabaseUser } from "embedding-sdk-bundle/types/user";
import { useLazySelector } from "embedding-sdk-package/hooks/private/use-lazy-selector";
import { getWindow } from "embedding-sdk-shared/lib/get-window";
/**
* Returns the current user.
* Returns `null` until the SDK is fully loaded and initialized.
*
* @function
* @category useCurrentUser
*/
export const useCurrentUser: () => MetabaseUser | null = () =>
useLazySelector(getWindow()?.METABASE_EMBEDDING_SDK_BUNDLE?.getUser) ?? null;