provider evaluations POST /api/projects/{project_id}/evaluations/test_hog/
@utdk/posthog /api/projects/{project_id}/evaluations/test_hog/
evaluations_test_hog_create
Test Hog evaluation code against sample events without saving.
project_id path required
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
string

Try it

Authentication
Configure credentials for PostHog API
evaluationsTestHogCreate
POST/api/projects/{project_id}/evaluations/test_hog/
Test Hog evaluation code against sample events without saving.

Parameters

required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Input

required

Hog source code to test. Must return a boolean (true = pass, false = fail) or null for N/A.

Number of recent $ai_generation events to test against (1–10, default 5).

Whether the evaluation can return N/A for non-applicable generations.

Optional trigger conditions to filter which events are sampled.

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import posthog from '@utdk/posthog';

await posthog.evaluationsTestHogCreate({
  "sample_count": 5,
  "allows_na": false
})