- Add authentication scripts with SubtleCrypto password encryption - Add sourcemap extraction pipeline (update-urls, download-sourcemaps, extract-sources) - Add Playwright API interception script for monetization endpoints - Document two-step auth flow with JWT tokens and dual cookies - Move extracted source from root to anyclip/ directory - Add project configuration (.env.example, .gitignore, CLAUDE.md)
2.4 KiB
AnyClip Monetization API Documentation
Note: This document should be populated after running the API interception script. Run
bun scripts/intercept-monetization.tsand interact with the monetization page to capture API endpoints.
Overview
The monetization analytics page uses several API endpoints to fetch and display revenue data, filtering options, and export capabilities.
Expected Endpoints
Based on component analysis, the following endpoints should be captured:
Metrics Totals
Fetches aggregate metrics for the dashboard cards.
Endpoint: TBD (populate from captured-apis.json)
Method: POST/GET
Request:
{
// To be documented after capture
}
Response:
{
// To be documented after capture
}
Chart Data (Time Series)
Fetches time-series data for the monetization charts.
Endpoint: TBD
Method: POST/GET
Request:
{
// To be documented after capture
}
Response:
{
// To be documented after capture
}
Filter Options
Demand Sources
Endpoint: TBD
Method: GET
Players
Endpoint: TBD
Method: GET
Domains
Endpoint: TBD
Method: GET
Countries
Endpoint: TBD
Method: GET
CSV Export
Endpoint for downloading monetization data as CSV.
Endpoint: TBD
Method: GET/POST
How to Update This Document
-
Run the interception script:
bun scripts/intercept-monetization.ts -
Log in to AnyClip in the browser window that opens
-
Once logged in, the script navigates to the monetization page
-
Interact with the page:
- Change date ranges
- Apply different filters (demand sources, players, domains, countries)
- Click export buttons
- Switch between chart views
-
Press
Ctrl+Cto stop capturing and save data -
Review
captured-apis.jsonin the project root -
Update this document with the captured endpoint details
Captured Data Format
The captured-apis.json file contains:
{
"capturedAt": "ISO timestamp",
"totalRequests": 42,
"requests": [
{
"timestamp": "ISO timestamp",
"url": "full URL",
"method": "GET/POST",
"headers": { ... },
"requestBody": "JSON string or null",
"responseStatus": 200,
"responseHeaders": { ... },
"responseBody": "JSON string",
"duration": 123
}
]
}