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

# useOrganization

> Read the organization identifier supplied to OrganizationProvider, returning the id string or undefined if unset.

API reference: [useOrganization()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.useorganization/index.md) (function)

`useOrganization` returns the organization identifier provided to [`OrganizationProvider`](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.organizationprovider/index.md). Use it to reach organization-level services, such as organization settings or users, through `backend.organization(id)`.

## [Basic usage](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/hooks/use-organization/#basic-usage)

```tsx
import { useBackendStrict, useOrganization } from "@gooddata/sdk-ui";

function MyComponent() {
    const backend = useBackendStrict();
    const organization = useOrganization();

    if (!organization) {
        return <div>No organization configured</div>;
    }

    // Access organization-level services
    const orgService = backend.organization(organization);
    // ...
}
```

## [Parameters](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/hooks/use-organization/#parameters)

None.

## [Return value](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/hooks/use-organization/#return-value)

`string | undefined`: the organization identifier, or `undefined` when no [`OrganizationProvider`](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.organizationprovider/index.md) up the tree sets one.

## [Notes](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/hooks/use-organization/#notes)

- Components re-render when [`OrganizationProvider`](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.organizationprovider/index.md) receives a new `organization` value.
- There is no strict variant. If your code can't work without an organization, check for `undefined` and render a fallback or throw, as in the example.
- The hook only returns the identifier; it makes no backend call. Combine it with a backend, for example from [`useBackendStrict`](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/hooks/use-backend/index.md), to load organization resources.
