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

# LoginPasswordlessSmsOtp

> Universal Login の `login-passwordless-sms-otp` 画面をカスタマイズするために利用できる、すべての Hooks とメソッドについて説明します。

`login-passwordless-sms-otp` 画面では、SMS によるパスワードレス SMS 認証を完了するために、ユーザーに電話番号に送信されたワンタイムパスワードの入力を求めます。

<Frame>
  <img style={{maxHeight:"400px"}} src="https://mintcdn.com/translations/c0RQ9V0YAcT0-8l5/docs/images/cdy7uua7fh8z/7CNCkaU1uPRbEUsAyqlj8u/8461823cf224471d19656e4dd9027a87/Screenshot_2025-04-24_at_11.31.00.png?fit=max&auto=format&n=c0RQ9V0YAcT0-8l5&q=85&s=111fb910ee7bca64cca38af9146e26ed" alt="Login パスワードレス SMS OTP" width="363" height="484" data-path="docs/images/cdy7uua7fh8z/7CNCkaU1uPRbEUsAyqlj8u/8461823cf224471d19656e4dd9027a87/Screenshot_2025-04-24_at_11.31.00.png" />
</Frame>

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

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

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

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

// 部分インポート
import {
  useLoginPasswordlessSmsOtp,
  // コンテキストHooks
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  // 共通Hooks
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティHooks
  useChangeLanguage,
  useResend,
  // メソッド
  submitOTP,
  resendOTP,
  switchConnection,
} from '@auth0/auth0-acul-react/login-passwordless-sms-otp';

function SmsOtpForm() {
  const { submitOTP } = useLoginPasswordlessSmsOtp();
  return (
    <button onClick={() => submitOTP({ code: '123456' })}>
      Verify Code
    </button>
  );
}
```

<div id="context-hooks">
  ## Context Hooks
</div>

`login-passwordless-sms-otp` 画面で Auth0 のコンテキストデータへの読み取り専用アクセスを提供する、画面に対してスコープが設定された Hooks です。`@auth0/auth0-acul-react/login-passwordless-sms-otp` からインポートします。

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

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

<ParamField body="useClient" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers">ClientMembers</a></span>}>
  この Hooks は、`login-passwordless-sms-otp` 画面の `id`、`name`、`logoUrl` など、クライアントに関連する設定を提供します。

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

<ParamField body="useOrganization" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers">OrganizationMembers</a></span>}>
  この Hooks は、ログインが organization にスコープ設定されている場合に、ユーザーの 組織 に関する情報を提供します。組織コンテキストが存在しない場合は `null` を返します。

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

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

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

<ParamField body="useScreen" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembersOnLoginPasswordlessSmsOtp">ScreenMembersOnLoginPasswordlessSmsOtp</a></span>}>
  この Hooks には、`login-passwordless-sms-otp` 画面に固有の詳細情報 (設定やコンテキストを含む) が含まれます。

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

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

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

<ParamField body="useTransaction" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembersOnLoginPasswordlessSmsOtp">TransactionMembersOnLoginPasswordlessSmsOtp</a></span>}>
  この Hooks は、`login-passwordless-sms-otp` 画面の transaction 固有のデータ (有効な 接続 や現在のフロー state など) を提供します。

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

<ParamField body="useUntrustedData" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers">UntrustedDataMembers</a></span>}>
  この Hooks は、URLパラメーター から事前入力された phone 番号など、画面に渡される信頼されていないデータを扱います。

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

<ParamField body="useUser" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers">UserMembers</a></span>}>
  この Hooks は、アクティブなユーザーの詳細情報 (`username`、`email`、利用可能な認証方法など) を提供します。

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

<ParamField body="useLoginPasswordlessSmsOtp" type={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/LoginPasswordlessSmsOtpMembers">LoginPasswordlessSmsOtpMembers</a>}>
  この Hooks は、`login-passwordless-sms-otp` 画面で利用できるすべてのメソッドとコンテキストを返します。
</ParamField>

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

<ParamField body="resendOTP" type="Promise<void>">
  このメソッドは、ワンタイムパスワード (OTP) をユーザーの電話番号に再送します。

  ```jsx Example theme={null}
  import { useLoginPasswordlessSmsOtp } from '@auth0/auth0-acul-react/login-passwordless-sms-otp';

  function ResendButton() {
    const { resendOTP } = useLoginPasswordlessSmsOtp();
    return (
      <button onClick={() => resendOTP()}>
        コードを再送信
      </button>
    );
  }
  ```
</ParamField>

<ParamField body="submitOTP" type="Promise<void>">
  このメソッドは、ワンタイムパスワードを送信してパスワードレス SMS 認証を完了します。

  ```jsx Example theme={null}
  import { useLoginPasswordlessSmsOtp } from '@auth0/auth0-acul-react/login-passwordless-sms-otp';

  function SmsOtpForm() {
    const { submitOTP } = useLoginPasswordlessSmsOtp();
    return (
      <button onClick={() => submitOTP({ code: '123456' })}>
        コードを検証
      </button>
    );
  }
  ```

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

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

    <ParamField body="code" type="string" required>
      ユーザーの電話番号に送信されたワンタイムパスワード。
    </ParamField>

    <ParamField body="username?" type="string">
      フローで必要な場合に指定する、ユーザーの電話番号または識別子。
    </ParamField>

    <ParamField body="captcha?" type="string">
      テナントでボット検出が有効な場合に必要な captcha 値。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="switchConnection" type="Promise<void>">
  このメソッドは、フローを最初からやり直すことなく、別の認証用接続に切り替えます。

  ```jsx Example theme={null}
  import { useLoginPasswordlessSmsOtp } from '@auth0/auth0-acul-react/login-passwordless-sms-otp';

  function ConnectionSwitcher() {
    const { switchConnection } = useLoginPasswordlessSmsOtp();
    return (
      <button onClick={() => switchConnection({ connection: 'enterprise-saml' })}>
        SSO を使用
      </button>
    );
  }
  ```

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

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

    <ParamField body="connection" type="string" required>
      切り替え先の接続名。パスワードレスの場合は 'email' または 'sms' を、パスワードベース認証の場合は DB 接続名を使用します。
    </ParamField>
  </Expandable>
</ParamField>

<div id="commonutility-hooks">
  ## 共通/Utility Hooks
</div>

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

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

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

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

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useResend">useResend</a>} type="Hooks">
  このフックは、コード再送アクションの再送クールダウンの state と利用可否を管理します。
</ParamField>
