Registry / devops / nayota-show-sdk

nayota-show-sdk

JSON →
library1.3.102jsnpmunverified

SDK for integrating with the Nayota Impossible Show platform (REST API). Current stable version 1.3.102. Provides auto-configured API modules (e.g., alarmRecord, deviceManagement) with token-based auth stored in cookies. Key differentiator: pre-built module-based interface generation from the Nayota config service, reducing boilerplate for Nayota ecosystem apps. Release cadence is regular (patch version increments). Primarily used in Chinese-speaking development communities.

npm install nayota-show-sdk
INSTALL
IMPORT
SIG · NAYOTA-SHOW-SDK
N
nayota-show-sdk
devopsjavascriptv1.3.102
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NayotaSdk
import NayotaSdk from 'nayota-show-sdk'
const NayotaSdk = require('nayota-show-sdk')
Default import, works with ESM bundlers. CommonJS require() may fail if the package is ESM-only.
alarmRecord
import { alarmRecord } from 'nayota-show-sdk'
import alarmRecord from 'nayota-show-sdk'
Named export for each module. Not a default export.
list
const { list } = alarmRecord
import { list } from 'nayota-show-sdk/alarmRecord'
Module methods are accessed after importing the module object, not via subpath imports.
config
import NayotaSdk from 'nayota-show-sdk'; NayotaSdk.config({...})
import { config } from 'nayota-show-sdk'
config is a method on the default export, not a named export.

Initializes the SDK with config, then calls list methods on alarmRecord and deviceManagement modules.

import NayotaSdk from 'nayota-show-sdk'; import { alarmRecord, deviceManagement } from 'nayota-show-sdk'; NayotaSdk.config({ authTokenName: 'Admin-Token', showServer: 'http://localhost:8080/api', }); async function main() { const alarms = await alarmRecord.list({ page: 1, limit: 50 }); console.log(alarms); const devices = await deviceManagement.list({ type: 'camera' }); console.log(devices); } main();
Debug
Known issues
breakingv1.3 removed the 'token' option from config: use 'authTokenName' to specify cookie key instead.
fix
Use NayotaSdk.config({ authTokenName: 'Your-Cookie-Key', ... }) instead of { token: '...' }.
affects: >=1.3.0
deprecatedThe method 'alarmRecord.createOne' is renamed to 'create' in v1.2.
fix
Use alarmRecord.create() instead of alarmRecord.createOne().
affects: >=1.2.0
gotchaThe SDK relies on cookie-based token storage. If cookies are disabled, authentication will fail.
fix
Ensure the browser/client environment supports cookies. For server-side usage, implement a custom token provider.
affects: *
gotchaImporting individual modules (e.g., import { list } from 'nayota-show-sdk/alarmRecord') will fail. All modules must be imported via the package root.
fix
Use import { alarmRecord } from 'nayota-show-sdk' then access alarmRecord.list.
affects: *
Errors
Common errors & fixes
TypeError: NayotaSdk.config is not a function
Using const NayotaSdk = require('nayota-show-sdk') (CommonJS) when the package expects import syntax.
fix
Switch to ES module import: import NayotaSdk from 'nayota-show-sdk'
import { alarmRecord } from 'nayota-show-sdk'; alarmRecord.list is undefined
Forgot to call NayotaSdk.config() before using modules.
fix
Call NayotaSdk.config({...}) before any module method calls.
Cannot find module 'nayota-show-sdk' or its corresponding type declarations
Missing TypeScript type definitions or package not installed.
fix
Run npm install nayota-show-sdk. If using TypeScript, ensure 'esModuleInterop' is true in tsconfig.
Upgrade
Version history
1.3.102latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
nayota-show-sdk — npm install nayota-show-sdk · libregistry