capturePrivateRegistryEvent
Track an event without validation.
Track an event without validation (skips path/user-agent checks).
Signature
function capturePrivateRegistryEvent(
request: Request,
token: string,
type?: "installed" | "viewed" | "downloaded",
config?: InsightcnConfig
): Promise<void>;Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
request | Request | - | The incoming HTTP request |
token | string | - | Your registry API key |
type | string | "installed" | Event type: "installed", "viewed", or "downloaded" |
config | object | {} | Optional configuration override |
Config Options
| Property | Type | Description |
|---|---|---|
apiUrl | string | Override default API URL |
Example
import { capturePrivateRegistryEvent } from "@insightcn/sdk";
const request = new Request("https://your-registry.com/r/ui/button.json", {
method: "GET",
headers: { "user-agent": "node-fetch" },
});
// Track without validation
await capturePrivateRegistryEvent(request, "your-api-key", "installed");When to Use
Use capturePrivateRegistryEvent when:
- Tracking internal events that don't come from HTTP requests
- Testing event tracking in development
- You need to bypass validation for special cases
Differences from captureRegistryEvent
| Feature | captureRegistryEvent | capturePrivateRegistryEvent |
|---|---|---|
| Path validation | Yes | No |
| User-agent check | Yes | No |
| IP extraction | Yes | Yes |
| Event storage | Yes | Yes |