# Javascript(JS)

## 🚀 Rocketfuel SDK Overview

The Rocketfuel SDK simplifies the integration of **age verification** and **payment (PayIn)** features into your web and mobile applications. It provides both **server-side** and **client-side** SDKs, ensuring secure and seamless integration across environments.

### Pre-Requisites

1. Setup your rocketfuel Account
2. Generate clientId, clientSecret and whitelist your domain
3. For ZKP
   1. Download CryptoX app from Goole play / ios app store
   2. OR download chrome extension

## Domain Whitelisting

Domain whitelisting ensures that your SDK can only be accessed from approved domains. This helps protect your merchant account from unauthorized usage.

<figure><img src="https://1226631082-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fxp9w5RKLdYBhhpcmcvEp%2Fuploads%2F6ddevQ70zdNDmpzKTUGI%2Fimage.png?alt=media&#x26;token=ad1a2d58-875b-47f7-9d81-a044ea2f36f7" alt=""><figcaption></figcaption></figure>

### Steps to Whitelist a Domain

1. **Login to your Merchant Portal**
2. **Navigate to Domain Whitelisting**\
   Go to: `Settings > Domain Whitelisting`
3. **Add Your Domain**
   * Enter the URL of the domain where you will be using the SDK.
   * Supported URL formats:

     * [http://example.com](http://example.com/)
     * [https://example.com](https://example.com/)
     * [http://localhost:3000](http://localhost:3000/) (for local development)

     **Note:** Do not include trailing slashes (`/`) in your URLs.
4. **Save Changes**\
   Click on the **Save** or **Add** button to whitelist the domain.
5. **Verify**\
   Once added, your domain should appear in the list of approved domains. Only requests originating from these domains will be allowed to use the SDK.

{% hint style="info" %}
**Important Notes:**

* Only URLs from whitelisted domains can load the SDK.
* Subdomains must be added explicitly if required, e.g., [https://app.example.com](https://app.example.com/).
  {% endhint %}

#### 📚 Documentation

* **Server SDK (Node.js)**\
  Use the server SDK for secure operations, including order creation, token management, and backend verification.\
  👉 [Rocketfuel Server SDK (Node.js)](https://docs.rocketfuel.inc/plug-ins-and-sdks/javascript-js/rocketfuel-sdk-nodejs?utm_source=chatgpt.com)
* **Client SDK (JavaScript)**\
  Use the client SDK to embed age verification widgets and payment buttons into your website or app.\
  👉 [Rocketfuel Client SDK](https://docs.rocketfuel.inc/plug-ins-and-sdks/javascript-js/rocketfuel-sdk-client?utm_source=chatgpt.com)

#### 🔑 Key Features

* **Age Verification (`AGE_VERIFICATION`)**: Ensure compliance by verifying user age before restricted actions.
* **Payment Collection (`PAYIN`)**: Collect payments securely using BTC, ETH and other supported currencies.
* **Cross-environment support**: Sandbox and production environments for smooth testing and deployment.
* **Modular integration**: Use via CDN, npm package, or with popular frameworks (React, Vue, Angular).

## Wallets That Can Be Used for Age Verification

Our system supports two environments: **Sandbox and Production.**

{% hint style="warning" %}
Important: If you are using the Sandbox environment, you must connect via Testnet wallets (mobile apps or browser extensions). Production wallets will not work with Sandbox.
{% endhint %}

### 1. Android

Sandbox (Testnet App): [Download Android Testnet App](https://play.google.com/store/apps/details?id=com.pioneeringtechventures.wallet.testnet\&hl=en_IN)

Production (Mainnet App): [Download Android Production App](https://play.google.com/store/apps/details?id=com.pioneeringtechventures.wallet\&hl=en_IN)

### 2. iOS

Sandbox (Testnet App via TestFlight): [Download iOS Testnet App](https://apps.apple.com/us/app/testflight/id899247664)

Production (Mainnet App - App Store): [Download iOS Production App](https://apps.apple.com/sg/app/cryptox-concordium-wallet/id1593386457)

### 3. Browser Wallet Chrome Extension

Extension Download (same for Sandbox & Production):\
[Download Chrome Wallet Extension](https://chromewebstore.google.com/detail/concordium-wallet/mnnkpffndmickbiakofclnpoiajlegmg?hl=en)

**Switching Network in Browser Wallet**

* Open the wallet extension in your browser.
* Click on the Network dropdown (usually at the top).
* Select the correct network:
  * Testnet → for Sandbox
  * Mainnet → for Production

<figure><img src="https://1226631082-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fxp9w5RKLdYBhhpcmcvEp%2Fuploads%2FzmyIglvgXfuyVwlRi1OG%2Fimage.png?alt=media&#x26;token=426ba1d9-73c0-40a2-91ec-6253530ea13b" alt=""><figcaption></figcaption></figure>
