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

# Quickstart

> Get up and running with TXCloud in under 5 minutes

## Prerequisites

Before you begin, you'll need:

* A TXCloud account ([sign up here](https://dashboard.txcloud.io/signup))
* An API key from your dashboard
* Node.js 18+ (for JavaScript SDK) or Python 3.8+ (for Python SDK)

## Step 1: Get Your API Key

<Steps>
  <Step title="Create an Account">
    Go to [dashboard.txcloud.io](https://dashboard.txcloud.io) and sign up for a free account.
  </Step>

  <Step title="Navigate to API Keys">
    In your dashboard, go to **Settings** → **API Keys**.
  </Step>

  <Step title="Create a New Key">
    Click **Create API Key**, give it a name, and select the permissions you need.

    <Warning>
      Store your API key securely. It will only be shown once!
    </Warning>
  </Step>
</Steps>

Your API key will look like this:

```
txc_live_a1b2c3d4e5f6g7h8i9j0...
```

## Step 2: Install the SDK

<Tabs>
  <Tab title="JavaScript">
    ```bash theme={null}
    npm install @txcloud/sdk
    # or
    yarn add @txcloud/sdk
    # or
    pnpm add @txcloud/sdk
    ```
  </Tab>

  <Tab title="Python">
    ```bash theme={null}
    pip install txcloud
    ```
  </Tab>

  <Tab title="Go">
    ```bash theme={null}
    go get github.com/txcloud/txcloud-go
    ```
  </Tab>

  <Tab title="cURL">
    No installation needed! Use cURL directly:

    ```bash theme={null}
    curl https://api.txcloud.io/v1/identity/verify \
      -H "Authorization: Bearer YOUR_API_KEY"
    ```
  </Tab>
</Tabs>

## Step 3: Initialize the Client

<CodeGroup>
  ```javascript JavaScript theme={null}
  import TXCloud from '@txcloud/sdk';

  const txcloud = new TXCloud({
    apiKey: process.env.TXCLOUD_API_KEY,
    // Optional: use sandbox for testing
    environment: 'sandbox' // or 'production'
  });
  ```

  ```python Python theme={null}
  from txcloud import TXCloud

  txcloud = TXCloud(
      api_key=os.environ.get("TXCLOUD_API_KEY"),
      environment="sandbox"  # or "production"
  )
  ```

  ```go Go theme={null}
  import "github.com/txcloud/txcloud-go"

  client := txcloud.NewClient(
      os.Getenv("TXCLOUD_API_KEY"),
      txcloud.WithEnvironment("sandbox"),
  )
  ```

  ```bash cURL theme={null}
  # Set your API key as an environment variable
  export TXCLOUD_API_KEY="txc_live_your_key_here"

  # All requests use the Authorization header
  curl https://api.txcloud.io/v1/... \
    -H "Authorization: Bearer $TXCLOUD_API_KEY"
  ```
</CodeGroup>

## Step 4: Verify Your First Identity

Let's verify a user's identity document:

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Verify an identity document
  const verification = await txcloud.identity.verify({
    document_front: fs.readFileSync('id_front.jpg', 'base64'),
    document_back: fs.readFileSync('id_back.jpg', 'base64'),
    selfie: fs.readFileSync('selfie.jpg', 'base64'),
    country: 'MA',
    document_type: 'national_id',
    checks: ['ocr', 'face_match', 'liveness', 'fraud']
  });

  console.log('Status:', verification.status);
  console.log('Name:', verification.extracted_data.full_name);
  console.log('Face Match:', verification.checks.face_match.match);
  ```

  ```python Python theme={null}
  # Verify an identity document
  with open('id_front.jpg', 'rb') as f:
      document_front = base64.b64encode(f.read()).decode()

  verification = txcloud.identity.verify(
      document_front=document_front,
      document_back=document_back,
      selfie=selfie,
      country="MA",
      document_type="national_id",
      checks=["ocr", "face_match", "liveness", "fraud"]
  )

  print(f"Status: {verification.status}")
  print(f"Name: {verification.extracted_data.full_name}")
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.txcloud.io/v1/identity/verify \
    -H "Authorization: Bearer $TXCLOUD_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "document_front": "base64_encoded_image...",
      "country": "MA",
      "document_type": "national_id",
      "checks": ["ocr", "face_match", "liveness"]
    }'
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "id": "ver_a1b2c3d4e5f6",
  "status": "verified",
  "created_at": "2025-01-15T10:30:00Z",
  
  "extracted_data": {
    "full_name": "Mohammed El Amrani",
    "date_of_birth": "1990-05-15",
    "document_number": "AE123456",
    "nationality": "Moroccan",
    "expiry_date": "2028-05-14"
  },
  
  "checks": {
    "ocr": { "status": "passed", "confidence": 0.95 },
    "face_match": { "status": "passed", "similarity": 0.92 },
    "liveness": { "status": "passed", "confidence": 0.98 },
    "fraud": { "status": "passed", "risk_score": 120 }
  }
}
```

<Check>
  **Congratulations!** You've successfully verified your first identity with TXCloud.
</Check>

## Step 5: Set Up Webhooks (Optional)

For async workflows, configure webhooks to receive real-time updates:

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Create a webhook endpoint
  const webhook = await txcloud.developers.webhooks.create({
    url: 'https://yourapp.com/webhooks/txcloud',
    events: [
      'identity.verification.completed',
      'identity.verification.failed',
      'fraud.signal.detected'
    ],
    secret: 'whsec_your_secret_here'
  });
  ```

  ```python Python theme={null}
  webhook = txcloud.developers.webhooks.create(
      url="https://yourapp.com/webhooks/txcloud",
      events=[
          "identity.verification.completed",
          "identity.verification.failed"
      ]
  )
  ```
</CodeGroup>

<Card title="Learn More About Webhooks" icon="webhook" href="/concepts/webhooks">
  Configure and secure your webhook endpoints
</Card>

## Next Steps

Now that you've made your first API call, explore more features:

<CardGroup cols={2}>
  <Card title="Fraud Detection" icon="shield-halved" href="/guides/fraud-detection">
    Add device intelligence and fraud signals
  </Card>

  <Card title="Transaction Scoring" icon="credit-card" href="/guides/transaction-monitoring">
    Score transactions in real-time
  </Card>

  <Card title="Credit Assessment" icon="chart-line" href="/guides/credit-assessment">
    Verify income and assess creditworthiness
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Explore all available endpoints
  </Card>
</CardGroup>

## Sandbox vs Production

<Info>
  TXCloud provides a **sandbox environment** for testing. Sandbox requests don't affect real data and use test credentials.
</Info>

| Environment | Base URL                            | API Key Prefix |
| ----------- | ----------------------------------- | -------------- |
| Sandbox     | `https://sandbox.api.txcloud.io/v1` | `txc_test_...` |
| Production  | `https://api.txcloud.io/v1`         | `txc_live_...` |

<Warning>
  Always use sandbox for development and testing. Production API calls may incur charges.
</Warning>

## Need Help?

<CardGroup cols={3}>
  <Card title="Discord" icon="discord" href="https://discord.gg/txcloud">
    Join our community
  </Card>

  <Card title="Email Support" icon="envelope" href="mailto:support@txcloud.io">
    [support@txcloud.io](mailto:support@txcloud.io)
  </Card>

  <Card title="Status Page" icon="signal" href="https://status.txcloud.io">
    Check API status
  </Card>
</CardGroup>
