> ## 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.

# MfaPhoneEnrollment

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

`mfa-phone-enrollment` 画面では、ユーザーは電話番号を入力し、受信方法を選択して、SMS または音声による MFA 用の電話番号を登録できます。

<Frame>
  <img style={{maxHeight:"400px"}} src="https://mintcdn.com/translations/HBxPtmNaQ-FaY59k/docs/images/ja-jp/cdy7uua7fh8z/3o4ohXUXfkVaaZy0992sgL/a84b54fa31fcbf2b0695c9ff08357887/Screenshot_2025-04-23_at_17.36.28.png?fit=max&auto=format&n=HBxPtmNaQ-FaY59k&q=85&s=95f04d8fb2b7f05f388d4e41a727916e" alt="MfaPhoneEnrollment" width="363" height="577" data-path="docs/images/ja-jp/cdy7uua7fh8z/3o4ohXUXfkVaaZy0992sgL/a84b54fa31fcbf2b0695c9ff08357887/Screenshot_2025-04-23_at_17.36.28.png" />
</Frame>

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

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

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

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

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

function MfaPhoneEnrollmentScreen() {
  const { continueEnrollment } = useMfaPhoneEnrollment();
  return (
    <button onClick={() => continueEnrollment({ phone: '+15551234567', type: 'sms' })}>
      Enroll Phone
    </button>
  );
}
```

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

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

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

  ```jsx Example theme={null}
  import { useBranding } from '@auth0/auth0-acul-react/mfa-phone-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>}>
  この フック は、`id`、`name`、`logoUrl` など、`mfa-phone-enrollment` 画面のクライアント関連設定を提供します。

  ```jsx Example theme={null}
  import { useClient } from '@auth0/auth0-acul-react/mfa-phone-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>}>
  この フック は、MFA フローが組織スコープの場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は `null` を返します。

  ```jsx Example theme={null}
  import { useOrganization } from '@auth0/auth0-acul-react/mfa-phone-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/mfa-phone-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/ScreenMembers">ScreenMembers</a></span>}>
  この フック は、設定やコンテキストなど、`mfa-phone-enrollment` 画面に固有の詳細を提供します。

  ```jsx Example theme={null}
  import { useScreen } from '@auth0/auth0-acul-react/mfa-phone-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/mfa-phone-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>}>
  この フック は、現在の MFA フローの状態など、`mfa-phone-enrollment` 画面のトランザクション固有のデータを提供します。

  ```jsx Example theme={null}
  import { useTransaction } from '@auth0/auth0-acul-react/mfa-phone-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/mfa-phone-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/mfa-phone-enrollment';
  function UserProfile() {
    const user = useUser();
  }
  ```
</ParamField>

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

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

<ParamField body="continueEnrollment" type="Promise<void>">
  このメソッドは、ユーザーの電話番号と選択した送信方法を送信して、MFA 用の電話番号を登録します。

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

  function PhoneEnrollmentForm() {
    const { continueEnrollment } = useMfaPhoneEnrollment();
    return (
      <button onClick={() => continueEnrollment({ phone: '+15551234567', type: 'sms' })}>
        Enroll Phone
      </button>
    );
  }
  ```

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

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

    <ParamField body="phone" type="string" required>
      MFA に登録する電話番号。
    </ParamField>

    <ParamField body="type" type="&#x22;sms&#x22; | &#x22;voice&#x22;" required>
      確認用 code の送信方法。

      * `sms`: code をテキストメッセージで送信します。
      * `voice`: code を音声通話で送信します。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="pickCountryCode" type="Promise<void>">
  このメソッドは国番号の選択画面に移動し、ユーザーが自分の電話番号の国番号を選択できるようにします。

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

  function PickCountryCodeButton() {
    const { pickCountryCode } = useMfaPhoneEnrollment();
    return (
      <button onClick={() => pickCountryCode()}>
        Select Country Code
      </button>
    );
  }
  ```
</ParamField>

<ParamField body="tryAnotherMethod" type="Promise<void>">
  このメソッドは MFA 方法の選択画面に移動し、ユーザーが別の認証要素を選択できるようにします。

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

  function TryAnotherMethodButton() {
    const { tryAnotherMethod } = useMfaPhoneEnrollment();
    return (
      <button onClick={() => tryAnotherMethod()}>
        Try Another Method
      </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>
