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

# System Configurations

> **Scope**\
> This section describes how to configure third-party integrations required for authentication and messaging services — including WhatsApp OTP via Meta and Google reCAPTCHA API keys.

***

## ⚙️ System Config Overview

Before deploying your production environment, ensure that all third-party configurations are properly set up.\
Each integration below has a specific purpose:

| Integration          | Purpose                                                     |
| -------------------- | ----------------------------------------------------------- |
| **WhatsApp (Meta)**  | Used for sending OTP codes and user notifications.          |
| **Google reCAPTCHA** | Used for protecting login and registration forms from bots. |

***

## 💬 WhatsApp Configurations

### 🧩 Step 1. Create a Meta (Facebook) Developer App

Go to [Meta for Developers](https://developers.facebook.com/apps)\
Click **Create App** → on the “Add Use Cases” screen scroll down and select **Other** → choose **Business** as the app type → **Next**.\
Fill in the following:

* **App Name:** e.g. `Your Project Name WhatsApp`
* **Contact Email:** your business email
* **Business Account:** select your company (or create one)\
  Then click **Create App**

✅ You’ll now see your **App Dashboard**.

***

### 💬 Step 2. Add the WhatsApp Product

In the left menu, scroll to **Add Product** → find **WhatsApp** → click **Set Up**.\
✅ The **WhatsApp Business Platform** is now linked to your app.

***

### ☎️ Step 3. Connect Your Business Phone Number

Open **App Dashboard → Products → WhatsApp → Getting Started**.\
Click **Add phone number** and fill in:

* **Display Name:** the name users will see (e.g. `Your Project Name`)
* **Business Name**, **Website**, and **Email**
* Enter your **Phone Number** (must not already be linked to any WhatsApp account)
* Verify with the 6-digit code sent to your phone

✅ Once verified, your number appears under your **WhatsApp Business Account**.

***

### 🏢 Step 4. Confirm Your Business Information

Visit [Business Settings](https://business.facebook.com/settings)\
→ **Business Info**\
Ensure the following are filled correctly:

* Legal Name
* Business Address
* Business Email
* Website URL

*(Verification documents are not required yet, but must match your business details.)*

***

### 🔑 Step 5. Create a Permanent Access Token

This token allows your backend to send WhatsApp messages through API.

**A. Create a System User**

Go to **Business Settings → System Users**\
Click **Add → Add System User**

* Name: `yourproject_api_user`
* Role: `Admin`

**B. Assign Permissions and Link App**

* Click your new **System User**
* Add Assets → Apps → your app → grant Full Control
* Add Assets → WhatsApp Accounts → your WhatsApp Account → grant Full Access
* Refresh the browser page

**C. Generate Token**

* Click **Generate New Token**
* Choose your **App**
* Enable:
  * `whatsapp_business_management`
  * `whatsapp_business_messaging`
* Enable **Never Expires**
* Copy the generated token and store it securely.

✅ This is your **Permanent Access Token**.

***

### 🧾 Step 6. Find Your Account Identifiers

Return to your app: **Developers → Your App → WhatsApp → Getting Started**\
Copy:

* **WhatsApp Business Account ID**
* **Phone Number ID**

✅ Both are required for integration.

***

### 💡 Step 7. Create an OTP Template

Go to [Message Templates](https://business.facebook.com/wa/manage/message-templates/)\
Click **Create Template** and choose:

* Category: `Authentication`
* Type: `Copy Code`
* Name: `otp_login`
* Language: `English (US)`

**Body Example:**

`{{1}} is your verification code.`
Do not share this code. It expires in 10 minutes.

Click **Submit** → wait for **Approved** status.\
✅ Copy the Template Name and Language Code.

***

### 🧰 Step 8. Share These Details with Developers

| Field                  | Example             | Location                         |
| ---------------------- | ------------------- | -------------------------------- |
| Phone Number ID        | `987654321098765`   | App → WhatsApp → Getting Started |
| Business Display Name  | `Your Project Name` | During number setup              |
| Sender Phone (E.164)   | `+120978282366`     | During number setup              |
| Permanent Access Token | `EAABcdEf...XYZ`    | Business Settings → System Users |
| Approved Template Name | `otp_login`         | WhatsApp Manager                 |
| Template Language Code | `en_US`             | WhatsApp Manager                 |

> **Share securely:** Use encrypted email or password manager.
