# DevTools

QTap Dev Tools is a browser-based interface for debugging production API calls. It uses the same familiar visual approach as Chrome DevTools, but for a completely different use case: troubleshooting server-side HTTP/S traffic in real-time.

When you need to see exactly what your application is sending to third-party APIs, or why an integration is failing, Dev Tools gives you instant visibility without deploying code changes.

{% hint style="info" %}
**Air-Gapped Ready**: DevTools runs entirely on `localhost` - no external services required. All data stays on your infrastructure, making it ideal for regulated environments and data sovereignty requirements.
{% endhint %}

***

### How to Enable

DevTools is built into the Qtap binary. You simply need to turn it on during startup using a flag or environment variable.

| **Method** | **Syntax**              | **Best For**              |
| ---------- | ----------------------- | ------------------------- |
| CLI Flag   | `--enable-dev-tools`    | Binary usage, Quick demos |
| Env Var    | `ENABLE_DEV_TOOLS=true` | Docker, Kubernetes, Helm  |

Once enabled, the interface is accessible at: `http://localhost:10001/devtools`

***

### Deployment Options

#### 1. Quick Start (Temporary)

The fastest way to inspect traffic immediately. This downloads Qtap to `/tmp` and starts capturing.

```bash
# Download and run with DevTools enabled
curl -s https://get.qpoint.io/demo | sudo sh -s -- --enable-dev-tools
```

#### 2. Production Binary

For persistent installation on a VM or bare metal server.

```bash
# 1. Install Qtap
curl -s https://get.qpoint.io/install | sudo sh

# 2. Run with DevTools enabled
sudo qtap --enable-dev-tools
```

#### 3. Docker

Run Qtap as a privileged container to capture host traffic.

```bash
docker run -d --name qtap \
  --user 0:0 --privileged \
  --cap-add CAP_BPF --cap-add CAP_SYS_ADMIN \
  --pid=host --network=host \
  -v /sys:/sys \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e TINI_SUBREAPER=1 \
  -e ENABLE_DEV_TOOLS=true \
  --ulimit=memlock=-1 \
  us-docker.pkg.dev/qpoint-edge/public/qtap:v0 \
  --log-level=info
```

#### 4. Kubernetes / Helm

Add the environment variable to your Pod spec or Helm values.

```yaml
# In your Pod spec or Helm values
env:
  - name: ENABLE_DEV_TOOLS
    value: "true"
```

*See* [*Kubernetes Installation*](https://docs.qpoint.io/getting-started/qtap/installation/kubernetes-manifest) *for full manifest details.*

***

### Core Use Cases

DevTools is designed for moments when you need to see "ground truth" data immediately.

#### 1. API Integration Debugging

The Problem: A third-party API is returning errors, but your logs don't show the full request context.

DevTools Insight:

* See the exact Authorization header sent (e.g., Did we send `Bearer` when they expected `Basic`?).
* Read the full error response body which often contains specific error codes hidden by application logic.
* View request timing to pinpoint latency.

#### 2. Production Incident Response

The Problem: A critical sync process is failing in production, and you can't wait for a deployment cycle to add debug logging.

DevTools Insight:

* SSH into the box, start Qtap, and watch the failure occur in real-time.
* Identify issues like 404 Not Found (endpoint changed) or DNS resolution failures instantly.
* Result: Diagnose the issue in minutes without touching application code.

#### 3. Third-Party Service Changes

The Problem: An integration that worked yesterday is broken today. Did the provider change their API?

DevTools Insight:

* Compare your application's requests (unchanged) against the provider's responses.
* Spot new requirements, such as a missing `X-API-Version` header or a change in the required payload structure.

#### 4. Webhook Debugging

The Problem: You aren't receiving webhooks from a provider. Is the network blocking them, or is your app rejecting them?

DevTools Insight:

* Verify if the webhook actually reaches the network interface.
* Inspect the signature headers and payload format to ensure they match your validation logic.

***

### Remote Access (SSH Tunnel)

Since DevTools listens on `localhost` for security, use an SSH tunnel to access it on a remote server from your local device.

```bash
# 1. Create tunnel (run on your laptop)
ssh -L 10001:localhost:10001 -N user@production-server

# 2. Open browser locally
open http://localhost:10001/devtools
```

***

Note: You can use DevTools (for real-time viewing) and S3 Storage (for permanent archiving) simultaneously by configuring both in your Qtap settings.
