# LaunchLabs Pre-Flight Testing Integration

## API Configuration
- Base URL: https://getlaunchlabs.com/api
- Auth Header: X-API-Key: YOUR_API_KEY_HERE

## When User Asks to Test/Audit/Pre-flight

Run assessments via the LaunchLabs API:

```bash
curl -X POST https://getlaunchlabs.com/api/scan \
  -H "X-API-Key: YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "THE_URL_TO_TEST",
    "agents": ["security", "seo", "mobile"]
  }'
```

## Available Agents

security, performance, mobile, accessibility, seo, copy, api, trust, legal, auth, billing, onboarding, journey, account, admin

## Bundles
- "quick" = seo, mobile, performance, copy, security (8 credits)
- "prelaunch" = all 15 agents (35 credits)

## Response Handling

Single agent returns: { reportId, grade, score, issues }
Multiple agents returns: { reports: [{ agent, reportId, grade, score }...] }

Each report is viewable at: https://getlaunchlabs.com/report/{reportId}

## The Feedback Loop

1. Run assessment
2. Parse issues from response
3. Apply fixes to codebase
4. Re-run assessment
5. Repeat until grade >= B

## Example Workflow

User: "Pre-flight my app"

1. Ask for URL if not provided
2. POST /api/scan with quick bundle
3. Review issues in response
4. Apply each fix to the codebase
5. Re-run assessment
6. Continue until passing

## Important Notes

- Each agent generates its own report (one report per agent)
- Credits are charged per agent run
- Reports are saved and accessible via /report/{reportId}
- For auth/billing/onboarding, provide test credentials via targetAuth
