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

# PhoneIdentifierEnrollment

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

`phone-identifier-enrollment` 画面は、ユーザーが識別子として電話番号を登録する必要がある場合に表示されます。この画面では、希望する確認方法 (SMS または音声通話) を選択し、登録プロセスを続行するか、前の手順に戻ることができます。

<Frame>
  <img style={{maxHeight:"400px"}} src="https://mintcdn.com/translations/c0RQ9V0YAcT0-8l5/docs/images/cdy7uua7fh8z/7kuQwDVmt0NkHCbQObLj8d/b690fd899f7c8525532d6d640298f2cd/PhoneIdentifierEnrollment.png?fit=max&auto=format&n=c0RQ9V0YAcT0-8l5&q=85&s=9cfe30a57c6dc034a55943924f55d5a0" alt="ACUL Phone Identifier Enrollment" width="480" height="628" data-path="docs/images/cdy7uua7fh8z/7kuQwDVmt0NkHCbQObLj8d/b690fd899f7c8525532d6d640298f2cd/PhoneIdentifierEnrollment.png" />
</Frame>

<div id="import">
  ## インポート
</div>

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

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

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

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

function PhoneIdentifierEnrollmentScreen() {
  const { continuePhoneEnrollment } = usePhoneIdentifierEnrollment();
  return (
    <button onClick={() => continuePhoneEnrollment({ type: 'text' })}>Send Code via SMS</button>
  );
}
```

<div id="context-hooks">
  ## コンテキストフック
</div>

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

<ParamField body="useBranding" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/BrandingMembers">BrandingMembers</a></span>}>
  このフックは、`phone-identifier-enrollment` 画面に表示されるロゴ、色、テーマ設定などのブランディング設定を提供します。

  ```jsx Example theme={null}
  import { useBranding } from '@auth0/auth0-acul-react/phone-identifier-enrollment';
  function CustomTheme() {
    const branding = useBranding();
  }
  ```
</ParamField>

<ParamField body="useClient" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers">ClientMembers</a></span>}>
  このフックは、`phone-identifier-enrollment` 画面で使用される `id`、`name`、`logoUrl` などのクライアント関連の設定を提供します。

  ```jsx Example theme={null}
  import { useClient } from '@auth0/auth0-acul-react/phone-identifier-enrollment';
  function AppInfo() {
    const client = useClient();
  }
  ```
</ParamField>

<ParamField body="useOrganization" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers">OrganizationMembers</a></span>}>
  このフックは、電話番号の登録が組織スコープの場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は `null` を返します。

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

<ParamField body="usePrompt" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PromptMembers">PromptMembers</a></span>}>
  このフックには、認証フロー内の現在のプロンプトに関するデータが含まれます。

  ```jsx Example theme={null}
  import { usePrompt } from '@auth0/auth0-acul-react/phone-identifier-enrollment';
  function FlowInfo() {
    const prompt = usePrompt();
  }
  ```
</ParamField>

<ParamField body="useScreen" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembersOnPhoneIdentifierEnrollment">ScreenMembersOnPhoneIdentifierEnrollment</a></span>}>
  このフックには、設定やコンテキストなど、`phone-identifier-enrollment` 画面に固有の詳細が含まれます。

  ```jsx Example theme={null}
  import { useScreen } from '@auth0/auth0-acul-react/phone-identifier-enrollment';
  function ScreenDebug() {
    const screen = useScreen();
  }
  ```
</ParamField>

<ParamField body="useTenant" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/TenantMembers">TenantMembers</a></span>}>
  このフックには、`id` や関連するメタデータなど、テナントに関するデータが含まれます。

  ```jsx Example theme={null}
  import { useTenant } from '@auth0/auth0-acul-react/phone-identifier-enrollment';
  function TenantInfo() {
    const tenant = useTenant();
  }
  ```
</ParamField>

<ParamField body="useTransaction" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembers">TransactionMembers</a></span>}>
  このフックは、アクティブな接続や現在のフローの状態など、`phone-identifier-enrollment` 画面のトランザクション固有のデータを提供します。

  ```jsx Example theme={null}
  import { useTransaction } from '@auth0/auth0-acul-react/phone-identifier-enrollment';
  function TransactionInfo() {
    const transaction = useTransaction();
  }
  ```
</ParamField>

<ParamField body="useUntrustedData" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers">UntrustedDataMembers</a></span>}>
  このフックは、URL クエリ文字列から事前入力されたパラメーターなど、画面に渡される信頼できないデータを提供します。

  ```jsx Example theme={null}
  import { useUntrustedData } from '@auth0/auth0-acul-react/phone-identifier-enrollment';
  function PrefilledForm() {
    const untrustedData = useUntrustedData();
  }
  ```
</ParamField>

<ParamField body="useUser" type={<span>() =&gt; <a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers">UserMembers</a></span>}>
  このフックでは、現在のユーザーの詳細 (`username`、`email`、利用可能な認証方法など) を取得できます。

  ```jsx Example theme={null}
  import { useUser } from '@auth0/auth0-acul-react/phone-identifier-enrollment';
  function UserProfile() {
    const user = useUser();
  }
  ```
</ParamField>

<ParamField body="usePhoneIdentifierEnrollment" type={<a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PhoneIdentifierEnrollmentMembers">PhoneIdentifierEnrollmentMembers</a>}>
  このフックは、`phone-identifier-enrollment` 画面で利用可能なすべてのメソッドとコンテキストを返します。
</ParamField>

<div id="methods">
  ## メソッド
</div>

<ParamField body="continuePhoneEnrollment" type="Promise<void>">
  このメソッドは、ユーザーが希望する電話による確認方法を送信し、登録フローを続行します。

  ```jsx Example theme={null}
  import { usePhoneIdentifierEnrollment } from '@auth0/auth0-acul-react/phone-identifier-enrollment';

  function EnrollButton() {
    const { continuePhoneEnrollment } = usePhoneIdentifierEnrollment();
    return (
      <button onClick={() => continuePhoneEnrollment({ type: 'text' })}>
        Send Code via SMS
      </button>
    );
  }
  ```

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

  <Expandable title="パラメーター">
    <ParamField body="options">
      [PhoneEnrollmentOptions](/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PhoneEnrollmentOptions)。
    </ParamField>

    <ParamField body="type" type="&#x22;text&#x22; | &#x22;voice&#x22;" required>
      確認コードの送信方法です。SMS の場合は "text"、音声通話の場合は "voice" を使用します。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="returnToPrevious" type="Promise<void>">
  このメソッドは、ユーザーを認証フローの前のステップに戻します。

  ```jsx Example theme={null}
  import { usePhoneIdentifierEnrollment } from '@auth0/auth0-acul-react/phone-identifier-enrollment';

  function BackButton() {
    const { returnToPrevious } = usePhoneIdentifierEnrollment();
    return (
      <button onClick={() => returnToPrevious()}>
        Back
      </button>
    );
  }
  ```
</ParamField>

<div id="commonutility-hooks">
  ## 共通/ユーティリティフック
</div>

<ParamField body={<a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Hooks/useAuth0Themes">useAuth0Themes</a>} type="Hooks">
  このフックは、ブランディングコンテキストから、フラット化された設定を含む現在のテーマオプションを取得します。
</ParamField>

<ParamField body={<a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Hooks/useChangeLanguage">useChangeLanguage</a>} type="Hooks">
  このフックは、現在のACUL画面の表示言語を変更するための関数を返します。
</ParamField>

<ParamField body={<a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Hooks/useCurrentScreen">useCurrentScreen</a>} type="Hooks">
  このフックは、現在の画面のコンテキストと状態を取得します。
</ParamField>

<ParamField body={<a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Hooks/useErrors">useErrors</a>} type="Hooks">
  このフックは、画面上のサーバー、クライアント、開発者のエラーを読み取って管理します。
</ParamField>
