> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OrganizationPicker

> Universal Login の `organization-picker` 画面をカスタマイズするために使用できる、すべてのフックとメソッドについて説明します。

`organization-picker` 画面は、ユーザーがログインする organization を選択する必要がある場合に表示されます。ユーザーは organization を選択するか、この選択ステップをスキップできます。

![ACUL Organization Picker](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/3aFR1VujjNlIauzRAuMapf/12e80cb2e3f131d2eb45aa0ca13f1d8c/Screenshot_2025-03-25_at_20.49.09.png)

## インポート

各画面には、それぞれ固有のフックとメソッドがあります。SDKは、各画面で **部分インポート** と **ルートインポート** をサポートしています。

* 部分インポートを使用すると、特定の用途に必要なコードだけを取り込めます。
* ルートインポートを使用すると、単一のバンドルからすべての画面を読み込めるため、想定されるあらゆる画面に対応する単一のビルドが必要な場合に便利です。

```jsx Import Example theme={null}
// ルートインポート
import { useOrganizationPicker } from '@auth0/auth0-acul-react';

// 部分インポート
import {
  useOrganizationPicker,
  // コンテキストフック
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  useExperiment,
  // 共通フック
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティフック
  useChangeLanguage,
  // メソッド
  selectOrganization,
  skipOrganizationSelection,
} from '@auth0/auth0-acul-react/organization-picker';

function OrganizationPickerScreen() {
  const { selectOrganization } = useOrganizationPicker();
  return (
    <button onClick={() => selectOrganization({ organization: 'my-org', state: 'abc123' })}>Select</button>
  );
}
```

## Context Hooks

`organization-picker` 画面で Auth0 のコンテキストデータへの読み取り専用アクセスを提供する、画面スコープのフックです。`@auth0/auth0-acul-react/organization-picker` からインポートします。

**useBranding** `() => [BrandingMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/BrandingMembers)`

このフックは、`organization-picker` 画面に表示されるロゴ、色、テーマ設定などのブランディング設定を提供します。

```jsx Example theme={null}
import { useBranding } from '@auth0/auth0-acul-react/organization-picker';
function CustomTheme() {
  const branding = useBranding();
}
```

**useClient** `() => [ClientMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers)`

このフックは、`organization-picker` 画面の `id`、`name`、`logoUrl` など、クライアント関連の設定を提供します。

```jsx Example theme={null}
import { useClient } from '@auth0/auth0-acul-react/organization-picker';
function AppInfo() {
  const client = useClient();
}
```

**useExperiment** `() => [ExperimentMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ExperimentMembers)`

このフックは、`organization-picker` 画面で実行中の [Experiment Center](/docs/docs/ja-jp/customize/experiment-center) のエクスペリメントを提供します。実行中のエクスペリメントがない場合 (または画面が `context_configuration` でオプトインしていない場合) は `null` を返します。

```jsx Example theme={null}
import { useExperiment } from '@auth0/auth0-acul-react/organization-picker';
function ExperimentBranch() {
  const experiment = useExperiment();
  if (!experiment) return null;
  return experiment.isControl ? <ControlUI /> : <TreatmentUI />;
}
```

**useOrganization** `() => [OrganizationMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers)`

このフックは、`organization-picker` 画面におけるユーザーのOrganizationコンテキストに関する情報を提供します。Organizationコンテキストが存在しない場合は `null` を返します。

```jsx Example theme={null}
import { useOrganization } from '@auth0/auth0-acul-react/organization-picker';
function OrgSelector() {
  const organization = useOrganization();
  if (!organization) {
    return <p>No Organization context</p>;
  }
}
```

**usePrompt** `() => [PromptMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/PromptMembers)`

このフックには、認証フロー内の現在の prompt に関するデータが含まれます。

```jsx Example theme={null}
import { usePrompt } from '@auth0/auth0-acul-react/organization-picker';
function FlowInfo() {
  const prompt = usePrompt();
}
```

**useScreen** `() => [ScreenMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembers)`

このフックには、設定やコンテキストを含む、`organization-picker` 画面固有の詳細が含まれます。

```jsx Example theme={null}
import { useScreen } from '@auth0/auth0-acul-react/organization-picker';
function ScreenDebug() {
  const screen = useScreen();
}
```

**useTenant** `() => [TenantMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TenantMembers)`

このフックには、`id` や関連するメタデータなど、テナントに関するデータが含まれます。

```jsx Example theme={null}
import { useTenant } from '@auth0/auth0-acul-react/organization-picker';
function TenantInfo() {
  const tenant = useTenant();
}
```

**useTransaction** `() => [TransactionMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembers)`

このフックは、アクティブな接続や現在のフロー状態など、`organization-picker` 画面の transaction 固有のデータを提供します。

```jsx Example theme={null}
import { useTransaction } from '@auth0/auth0-acul-react/organization-picker';
function TransactionInfo() {
  const transaction = useTransaction();
}
```

**useUntrustedData** `() => [UntrustedDataMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers)`

このフックは、URL のクエリ文字列で事前入力されたパラメーターなど、画面に渡される信頼できないデータを処理します。

```jsx Example theme={null}
import { useUntrustedData } from '@auth0/auth0-acul-react/organization-picker';
function PrefilledForm() {
  const untrustedData = useUntrustedData();
}
```

**useUser** `() => [UserMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers)`

このフックは、`username`、`email`、利用可能な認証方法など、現在のユーザーに関する情報を提供します。

```jsx Example theme={null}
import { useUser } from '@auth0/auth0-acul-react/organization-picker';
function UserProfile() {
  const user = useUser();
}
```

**useOrganizationPicker** `[OrganizationPickerMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationPickerMembers)`

このフックは、`organization-picker` 画面で利用できるすべてのメソッドとコンテキストを返します。

## メソッド

**selectOrganization** `Promise\<void\>`

このメソッドは、ユーザーが選択した組織を送信し、認証フローを続行します。

```jsx Example theme={null}
import { useOrganizationPicker } from '@auth0/auth0-acul-react/organization-picker';

function SelectButton() {
  const { selectOrganization } = useOrganizationPicker();
  return (
    <button onClick={() => selectOrganization({ organization: 'my-org', state: 'abc123' })}>
      Select Organization
    </button>
  );
}
```

**メソッドのパラメータ**

**パラメータ**

**options**

[SelectOrganizationOptions](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/SelectOrganizationOptions)。

**organization** `string` *required*

ユーザーが選択した組織の識別子です。

**state** `string` *required*

現在の認証 state の値です。

**skipOrganizationSelection** `Promise\<void\>`

このメソッドを使用すると、ユーザーは組織の選択をスキップし、組織を選択せずに認証フローを続行できます。

```jsx Example theme={null}
import { useOrganizationPicker } from '@auth0/auth0-acul-react/organization-picker';

function SkipButton() {
  const { skipOrganizationSelection } = useOrganizationPicker();
  return (
    <button onClick={() => skipOrganizationSelection()}>
      Skip
    </button>
  );
}
```

## 共通/ユーティリティ Hooks

**[useAuth0Themes](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useAuth0Themes)** `フック`

このフックは、ブランディングコンテキストからフラット化された設定を含む現在のテーマオプションを取得します。

**[useChangeLanguage](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useChangeLanguage)** `フック`

このフックは、現在の ACUL 画面の表示言語を変更するための関数を返します。

**[useCurrentScreen](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useCurrentScreen)** `フック`

このフックは、現在の画面のコンテキストと状態を取得します。

**[useErrors](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useErrors)** `フック`

このフックは、画面上のサーバー、クライアント、開発者のエラーを読み取って管理します。
