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

# SignupId

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

`signup-id` 画面では、複数ステップのサインアップフローの最初のステップとして、メールアドレス、ユーザー名、電話番号などの識別子をユーザーから収集します。また、ソーシャル接続またはエンタープライズ接続、Google One Tap を使用したフェデレーションサインアップにも対応しています。

![Signup ID](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/5lzGYj0k4VcxvPCBYH37SO/ebd291cc0dbd673a70f93530f724bf65/Signup_ID.png)

## インポート

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

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

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

// 部分インポート
import {
  useSignupId,
  // コンテキストフック
  useUser,
  useTenant,
  useBranding,
  useClient,
  useCountryCodes,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  useExperiment,
  // 共通フック
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティフック
  useChangeLanguage,
  useSignupIdentifiers,
  useUsernameValidation,
  // メソッド
  signup,
  federatedSignup,
  googleOneTap,
  pickCountryCode,
} from '@auth0/auth0-acul-react/signup-id';

function SignupIdForm() {
  const { signup } = useSignupId();
  return (
    <button onClick={() => signup({ email: 'user@example.com' })}>
      Continue
    </button>
  );
}
```

## Context Hooks

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

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

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

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

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

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

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

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

この Hooks は、`signup-id` 画面で利用可能な電話の国番号と推奨される既定値を提供します。

```jsx Example theme={null}
import { useCountryCodes } from '@auth0/auth0-acul-react/signup-id';
function CountryPicker() {
  const countryCodes = useCountryCodes();
  const available = countryCodes?.available;
}
```

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

この Hooks は、`signup-id` 画面で実行中の [Experiment Center](/docs/docs/ja-jp/customize/experiment-center) の experiment を提供します。実行中の experiment がない場合 (または画面が `context_configuration` でオプトインしていない場合) は `null` を返します。

```jsx Example theme={null}
import { useExperiment } from '@auth0/auth0-acul-react/signup-id';
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)`

この Hooks は、サインアップが組織スコープの場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は `null` を返します。

```jsx Example theme={null}
import { useOrganization } from '@auth0/auth0-acul-react/signup-id';
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)`

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

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

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

この Hooks には、設定やコンテキストを含む、`signup-id` 画面に固有の詳細情報が含まれます。

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

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

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

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

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

このフックは、アクティブな接続や現在のフローの状態など、`signup-id` 画面のトランザクション固有のデータを提供します。

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

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

このフックは、URL パラメーターから事前入力された email や username など、画面に渡される信頼できないデータを扱います。

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

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

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

## メソッド

**googleOneTap** `Promise\<void\>`

このメソッドは、Google One Tap 認証情報を使用して新しいユーザーを登録し、別のページにリダイレクトすることなくワンクリックでサインアップできるようにします。

```jsx Example theme={null}
import { useSignupId } from '@auth0/auth0-acul-react/signup-id';

function GoogleOneTapHandler({ credential }) {
  const { googleOneTap } = useSignupId();
  return googleOneTap({ one_tap_credential: credential });
}
```

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

**パラメーター**

**one\_tap\_credential** `string` *required*

Google Identity Services のプロンプトから返される Google One Tap 認証情報トークン。

**federatedSignup** `Promise\<void\>`

このメソッドは、サインアップのためにユーザーを[ソーシャル](/docs/docs/ja-jp/authenticate/identity-providers/social-identity-providers)または[エンタープライズ ID プロバイダー](/docs/docs/ja-jp/authenticate/identity-providers/enterprise-identity-providers) (IdP) にリダイレクトします。

```jsx Example theme={null}
import { useSignupId } from '@auth0/auth0-acul-react/signup-id';

function SocialButton() {
  const { federatedSignup } = useSignupId();
  return (
    <button onClick={() => federatedSignup({ connection: 'google-oauth2' })}>
      Sign up with Google
    </button>
  );
}
```

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

**パラメーター**

**options**

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

**connection** `string` *required*

ソーシャルまたはエンタープライズ ID プロバイダーの接続名。

**pickCountryCode** `Promise\<void\>`

このメソッドは、サインアップ時の電話番号入力で使用する国番号ピッカーを開きます。

```jsx Example theme={null}
import { useSignupId } from '@auth0/auth0-acul-react/signup-id';

function CountryCodePicker() {
  const { pickCountryCode } = useSignupId();
  return (
    <button onClick={() => pickCountryCode()}>
      Select Country Code
    </button>
  );
}
```

**signup** `Promise\<void\>`

このメソッドは、ユーザーの識別子を送信して、サインアップフローの次のステップに進みます。

```jsx Example theme={null}
import { useSignupId } from '@auth0/auth0-acul-react/signup-id';

function SignupIdForm() {
  const { signup } = useSignupId();
  return (
    <button onClick={() => signup({ email: 'user@example.com' })}>
      Continue
    </button>
  );
}
```

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

**パラメーター**

**options**

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

**email** `string`

ユーザーのメールアドレス。

**username** `string`

接続で必要な場合に使用する、新しいアカウントのユーザー名。

**phone** `string`

接続で必要な場合のユーザーの電話番号。

**phoneCountryCode?** `string`

`phone` に対してユーザーが選択した ISO 3166-1 alpha-2 の国 (例: `'US'`) で、`countryCodes.available` 内の `code` から指定します。送信された国が優先され、サーバーがその国番号を先頭に付加するため、`phone` には国番号を含まない国内番号を指定してください。省略した場合は従来の動作が維持され、サーバーが国を判定し、`pickCountryCode()` によって別画面で選択を変更します。

**captcha?** `string`

テナントでボット検出が有効になっている場合に必要な captcha 値。

**\[`key`: `string`]** `"string" | "number" | "boolean" | "undefined"`

`ulp-` で始まる追加のカスタムフィールド (例: `'ulp-custom-field'`) 。

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

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

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

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

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

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

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

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

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

**[useSignupIdentifiers](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useSignupIdentifiers)** `Hooks`

このフックは、接続に設定されている Signup で利用可能な identifier types (email、ユーザー名、phone) を返します。

**[useUsernameValidation](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useUsernameValidation)** `Hooks`

このフックは、テナントのユーザー名ポリシー要件に照らして、ユーザーのユーザー名を検証します。
