diff --git a/CHANGELOG.md b/CHANGELOG.md index 123ce78..ecbebc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.30.1] - 2026-08-26 + +### Fixed + +- **`context.platform`'s doc comment described the wrong thing.** It read "Platform type (e.g. \"chat\", \"social_media\", \"gaming\")", but the SDK treats the value as your app/product name and appends its own identifier before sending it — `"MyApp"` reaches the API as `"MyApp - Node SDK"`. Following the old doc's examples sent a bare category string instead of an identifiable app name, which is what shows up for dashboard attribution. Corrected here and on the equivalent `platform` fields across image/video/voice/document/synthetic-content inputs and the batch/voice-stream context shapes. No behavior change — types and doc comments only. + ## [2.30.0] - 2026-08-26 ### Added diff --git a/package.json b/package.json index c976a30..bd72e82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tuteliq/sdk", - "version": "2.30.0", + "version": "2.30.1", "description": "TypeScript SDK for Tuteliq AI child safety API - Detect bullying, grooming, and unsafe content", "type": "module", "main": "./dist/index.js", diff --git a/src/types/index.ts b/src/types/index.ts index 6eb4b94..4a08d11 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -236,6 +236,11 @@ export interface BatchItemBase { language?: string; ageGroup?: string; relationship?: string; + /** + * Your platform/app name (e.g. "MyApp"), used for dashboard + * attribution. The SDK appends its own identifier before sending it — + * "MyApp" is sent to the API as "MyApp - Node SDK". + */ platform?: string; country?: string; }; diff --git a/src/types/media.ts b/src/types/media.ts index c80ac72..a981992 100644 --- a/src/types/media.ts +++ b/src/types/media.ts @@ -47,7 +47,13 @@ export interface AnalyzeVoiceInput extends TrackingFields { ageGroup?: string; /** Language hint */ language?: string; - /** Platform name */ + /** + * Your platform/app name (e.g. "MyApp", "Discord Bot"), used for dashboard + * attribution and calibration. The SDK appends its own identifier before + * sending it — "MyApp" is sent to the API as "MyApp - Node SDK" — so + * pass your product's name here, not a category like "chat" or + * "social_media". + */ platform?: string; /** Child's age (used for grooming analysis) */ childAge?: number; @@ -138,7 +144,13 @@ export interface AnalyzeVideoInput extends TrackingFields { fileId?: string; /** Age group for calibrated analysis */ ageGroup?: string; - /** Platform name */ + /** + * Your platform/app name (e.g. "MyApp", "Discord Bot"), used for dashboard + * attribution and calibration. The SDK appends its own identifier before + * sending it — "MyApp" is sent to the API as "MyApp - Node SDK" — so + * pass your product's name here, not a category like "chat" or + * "social_media". + */ platform?: string; /** * Additive, deterministic word-list flag for plain profanity/vulgarity @@ -251,7 +263,13 @@ export interface AnalyzeImageInput extends TrackingFields { fileId?: string; /** Age group for calibrated analysis */ ageGroup?: string; - /** Platform name */ + /** + * Your platform/app name (e.g. "MyApp", "Discord Bot"), used for dashboard + * attribution and calibration. The SDK appends its own identifier before + * sending it — "MyApp" is sent to the API as "MyApp - Node SDK" — so + * pass your product's name here, not a category like "chat" or + * "social_media". + */ platform?: string; /** * Additive, deterministic word-list flag for plain profanity/vulgarity @@ -350,7 +368,13 @@ export interface AnalyzeDocumentInput extends TrackingFields { ageGroup?: string; /** Language hint (ISO 639-1) */ language?: string; - /** Platform name */ + /** + * Your platform/app name (e.g. "MyApp", "Discord Bot"), used for dashboard + * attribution and calibration. The SDK appends its own identifier before + * sending it — "MyApp" is sent to the API as "MyApp - Node SDK" — so + * pass your product's name here, not a category like "chat" or + * "social_media". + */ platform?: string; /** Minimum severity to include crisis helplines. Default: "high". */ supportThreshold?: 'low' | 'medium' | 'high' | 'critical'; diff --git a/src/types/safety.ts b/src/types/safety.ts index d89f18c..b1b5302 100644 --- a/src/types/safety.ts +++ b/src/types/safety.ts @@ -110,7 +110,12 @@ export type ContextInput = string | { ageGroup?: string; /** Relationship between participants (e.g., "classmates", "strangers") */ relationship?: string; - /** Platform type (e.g., "chat", "social_media", "gaming") */ + /** + * Your platform/app name (e.g. "MyApp", "Discord Bot"), used for dashboard + * attribution and calibration. The SDK appends its own identifier before + * sending it — "MyApp" is sent to the API as "MyApp - Node SDK" — so pass + * your product's name here, not a category like "chat" or "social_media". + */ platform?: string; /** ISO 3166-1 alpha-2 country code (e.g., "GB", "US") for geo-localised helpline data */ country?: string; diff --git a/src/types/synthetic.ts b/src/types/synthetic.ts index 046e518..f64f3c2 100644 --- a/src/types/synthetic.ts +++ b/src/types/synthetic.ts @@ -99,7 +99,13 @@ export interface DetectSyntheticImageInput extends TrackingFields { ageGroup?: string; /** Language hint (ISO 639-1) */ language?: string; - /** Platform name */ + /** + * Your platform/app name (e.g. "MyApp", "Discord Bot"), used for dashboard + * attribution and calibration. The SDK appends its own identifier before + * sending it — "MyApp" is sent to the API as "MyApp - Node SDK" — so + * pass your product's name here, not a category like "chat" or + * "social_media". + */ platform?: string; /** Skip verdict cache (both read and write). See bypassCache on DetectSyntheticTextInput. */ bypassCache?: boolean; @@ -247,7 +253,13 @@ export interface DetectSyntheticAudioInput extends TrackingFields { ageGroup?: string; /** Language hint (ISO 639-1) */ language?: string; - /** Platform name */ + /** + * Your platform/app name (e.g. "MyApp", "Discord Bot"), used for dashboard + * attribution and calibration. The SDK appends its own identifier before + * sending it — "MyApp" is sent to the API as "MyApp - Node SDK" — so + * pass your product's name here, not a category like "chat" or + * "social_media". + */ platform?: string; /** Skip verdict cache (both read and write). See bypassCache on DetectSyntheticTextInput. */ bypassCache?: boolean; @@ -335,7 +347,13 @@ export interface DetectSyntheticVideoInput extends TrackingFields { ageGroup?: string; /** Language hint (ISO 639-1) */ language?: string; - /** Platform name */ + /** + * Your platform/app name (e.g. "MyApp", "Discord Bot"), used for dashboard + * attribution and calibration. The SDK appends its own identifier before + * sending it — "MyApp" is sent to the API as "MyApp - Node SDK" — so + * pass your product's name here, not a category like "chat" or + * "social_media". + */ platform?: string; /** Skip verdict cache (both read and write). See bypassCache on DetectSyntheticTextInput. */ bypassCache?: boolean; diff --git a/src/types/voice-stream.ts b/src/types/voice-stream.ts index 1eabe74..094edea 100644 --- a/src/types/voice-stream.ts +++ b/src/types/voice-stream.ts @@ -15,6 +15,11 @@ export interface VoiceStreamConfig { language?: string; ageGroup?: string; relationship?: string; + /** + * Your platform/app name (e.g. "MyApp"), used for dashboard + * attribution. The SDK appends its own identifier before sending it — + * "MyApp" is sent to the API as "MyApp - Node SDK". + */ platform?: string; }; }