# Google One Tap

**Initialization Process:** To initialize Google One Tap login, use the following parameters:

```javascript
csc('google-one-tap', {
    clientId,
    contentId: storyContent,
    successCallback: (data: {
	loggedIn:true,
        userId:string,
	email:string,
	name:string,
	phoneNumber:string}) 
		=> {
      console.log(data.loggedIn);
    },
    oneTapArgs: (data: argsObject) => {
      console.log(data);
    },
});
```

| Parameter       | Description                                                                                                                                    |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| clientId        | The unique identifier provided by Conscent for authenticating the client.                                                                      |
| contentId       | The ID of the content where the One Tap login is integrated.                                                                                   |
| successCallback | A callback function is triggered upon successful user login.                                                                                   |
| oneTapArgs      | A callback function returns information related to the One Tap process, including any errors or reasons for not displaying the One Tap prompt. |

**Parameters Overview**

The argsObject will return the following object type:

```javascript
argsObject = {
    getNotDisplayedReason: "browser_not_supported" || "Missing_client_id" || "Opt_out_or_no_session" || "Secure_http_required" || "Suppressed_by_user" || "Unregistered_origin" || "Unknown_reason",
    isDisplayed: true || false,
    isNotDisplayed: true || false,
    getSkippedReason: "auto_cancel" || "user_cancel" || "tap_outside" || "issuing_failed"
};
```

* **getNotDisplayedReason**: Provides reasons for not displaying the One Tap prompt. Choose from the available options.
* **isDisplayed**: Indicates whether the One Tap prompt is displayed.
* **isNotDisplayed**: Indicates whether the One Tap prompt is not displayed.
* **getSkippedReason**: Provides reasons for skipping the One Tap prompt.

#### URL Whitelisting on GCP

Ensure the following URLs are whitelisted according to the environment:

* **Sandbox**: `https://`sandbox-sso-v2.netlify.app`/`
* **Production**: `https://`slp-v2.netlify.app`/`
