@apocaliss92/camstack-js-sdk
v0.1.6
Published
Shared types, constants, and utilities for the CamStack ecosystem.
Readme
@apocaliss92/camstack-js-sdk
Shared types, constants, and utilities for the CamStack ecosystem.
Overview
This SDK provides the shared foundation used by both the CamStack proxy (Node.js backend) and the CamStack app (Expo/React Native frontend). It ensures type safety and consistency across the entire stack.
Installation
npm install @apocaliss92/camstack-js-sdkWhat's Included
Detection Classes (detection)
DetectionClassenum and sub-class arrays (animals, persons, vehicles, faces, etc.)- Classification helpers:
isFaceClassname(),isAnimalClassname(),getParentClass(), etc. - Timeline presets:
TIMELINE_PRESET_CRITICAL,TIMELINE_PRESET_IMPORTANT,TIMELINE_PRESET_ALL - Default enabled classes configuration
Device Types (devices)
CanonicalDeviceType— normalized device type unionRAW_TO_CANONICAL— mapping from Scrypted PascalCase / HA domains to canonical typesELIGIBLE_SCRYPTED_DEVICE_TYPES,ELIGIBLE_HA_DOMAINS— supported device filtersDevice,DeviceCommand,CommandResultinterfaces
Timeline & Events (timeline)
DetectionEvent,MotionItem,TimelineArtifact— timeline data typesTimelineCluster,DetectionGroup— server-side grouping typesCameraDayDataResponse,ClusteredDayDataResponse— API response shapes- Query types for clustered data, grouped events, and reels
Camera & PTZ (camera)
CameraSourceType("scrypted" | "frigate" | "onvif" | "rtsp")PanTiltZoomCommand,PanTiltZoomCapabilitiesCameraAccessorySwitchKind,CameraStatusEntry
Feature Matrix (features)
FEATURE_MATRIX— static capability table (features x sources x platforms)isFeatureAvailable(),getSourceFeatures(),getBackendRequiredFeatures()
NVR Types (nvr)
NvrCamera,NvrEvent,NvrConfig— NVR provider typesRecordingSegment,MotionBucket,StreamInfoNvrVideoClip,VideoClipsQuery,VideoClipsResult- Event/motion/recording query interfaces
Client (client, proxy-client, direct-client)
CamStackClient— auto-detecting client (proxy or direct)ProxyClient— connects via WebSocket to camstack-proxyDirectClient— connects directly to NVR HTTP API
License
MIT
