CogAgg vNextBETA
HomeDeveloper login

Developer documentation

Connect your application to CogAgg vNext in a few steps. You don't need AWS access, a Cognito client ID, or a CogAgg deployment.

1. Sign in

Create a developer account or sign in with your existing CogAgg account. Enter your developer name when prompted.

2. Add your application

Open Developer integration and choose Add app. Enter a unique application name (up to 60 characters), a description (up to 200 characters), and your website domain (for example, game.example.com). Save the app to register it automatically.

3. Copy your integration token

The portal generates a token and shows it once. Copy it immediately and keep it secure. If you lose it, use Rotate token on your application's card; the previous token stops working.

4. Send your first event

Copy the exact App Name and Domain from your application card in Developer integration. Replace all three placeholders below with your registered values. The app_name must match the registered name exactly (including capitalization and spaces), or the API returns Invalid metrics payload.

curl -X POST 'https://27tn15t0xk.execute-api.us-west-2.amazonaws.com/v1/integration/metrics' \
  -H 'Content-Type: application/json' \
  -H 'X-Integration-Token: PASTE_YOUR_INTEGRATION_TOKEN' \
  -H 'Origin: https://YOUR_REGISTERED_DOMAIN' \
  -d '{
    "app_name": "YOUR_EXACT_REGISTERED_APP_NAME",
    "event_name": "GameCompleted",
    "data": {
      "score": {
        "metric_description": "Final game score",
        "value": "42"
      }
    }
  }'

The example payload has the required app_name, event_name, and data fields. Each entry in data must contain exactly two string fields: metric_description and value. Use the exact registered application name for app_name and the registered HTTPS domain for Origin. Browser requests must originate from the registered domain or its subdomains. A token authorizes writing events for that application only; it does not sign in your users or grant access to their private data.

5. Describe the meaning of every measurement

CogAggNext is designed for behavioral, cognitive, and rehabilitation specialists to examine longitudinal performance in memory, learning, motor/response, engagement, attention, and related domains. The same numeric trend can mean opposite things depending on the measurement. Lower reaction time often indicates faster response (improvement), while more wrong answers can indicate reduced task accuracy (regression). More time spent in an application indicates engagement, not necessarily improved cognition.

Keep metric_description explicit, specific, and stable. Include the skill being tested, unit, scoring definition, whether higher or lower is better, and important context such as difficulty, trial type, device, or session. Example:

"response_time_ms": {"metric_description":"Motor response latency in milliseconds from stimulus to key press; lower is better; difficulty level 2", "value":"420"},
"wrong_answers": {"metric_description":"Number of incorrect answers in the memory recall task; lower is better; 10 trials", "value":"2"},
"recall_accuracy_pct": {"metric_description":"Memory recall accuracy percentage across 10 trials; higher is better", "value":"80"}

CogAggNext makes provisional interpretations from data keys and descriptions. A developer can open Metrics Explorer → Event schema, select a schema row, and edit each metric's skill domain, improvement direction, and description. Saved developer definitions take precedence over inferred suggestions in Cog Analysis. Interpretations do not change the original events and are shared for that application's metrics.

Important: An automatically inferred direction is a suggestion, not a validated clinical interpretation. Avoid assuming higher engagement is better cognition, or comparing performance across changing game difficulty. For clinical or rehabilitation use, validate measurement reliability, baseline suitability, and context independently. A descriptive trend is not a diagnosis.

6. Manage your integration

Return to Developer integration to update the name, description or domain, rotate a token, or delete an application. No CogAgg deployment is needed for these changes.

Security: Tokens placed in public JavaScript can be copied. Origin checks help with browser requests but are not proof of domain ownership and can be forged outside a browser. For sensitive or high-trust events, submit from your own backend and protect the token as a secret.

7. Explore and interpret recorded data

In the Developer portal, registered applications start collapsed. Each application summary shows its icon, name and description; expand a card to see identifiers, configuration and management actions.

Cog Analysis supports selecting multiple measurements from one application. Tick measurement checkboxes to compare independent trends and their own baseline/recent averages. When comparing several metrics, the trend visualization indexes metrics with adequate nonzero baselines to 100; avoid comparing raw units across unlike measurements. Export the selected set as CSV, JSON, or chart PNG. This is descriptive telemetry rather than a validated clinical score.

Use Metrics Explorer to review events and Event Schema definitions. Metric descriptions appear in collapsed schema summaries; expand a data key to edit its description, skill domain and whether higher or lower is better. Close discards unsaved changes. Saved developer definitions override inferred suggestions; historical events are not modified.

Use Cog Analysis for longitudinal trends, baseline comparisons, distributions and activity heatmaps. History defaults to the last 1 day and loads automatically after sign-in; changing the history window reloads the query, including valid custom start/end times. Export selected measurements as CSV, JSON or PNG. Queries are scoped to the authenticated user, limited to 730 days and 5,000 events, and may incur Athena charges. Observed trends are not clinical diagnoses.

8. API contract and deployment synchronization

The OpenAPI 3.1 contract documents integration ingestion, metric submission/retrieval, user profiles, developer-confirmed interpretations, and long-term Athena analysis. The publish script validates and synchronizes the API contract and this documentation on every website deployment.