@nextsdk/core
v1.0.8
Published
NEXT SDK for JavaScript/TypeScript - Library for integrating .next file reading
Downloads
966
Maintainers
Readme
NEXT SDK
Main library for integrating .next file reading in websites and applications. Handles decryption, license validation, and provides a complete API for displaying interactive content.
🎯 Supported Languages
The NEXT SDK is focused on JavaScript/TypeScript for the web (websites, PWAs, web applications).
✨ Features
- File Processing: Decrypt and parse .next files with advanced AES encryption
- Interactive Content: Display pages with hotspots, translations, and responsive design
- Audio Management: Advanced audio controls with auto-play, preloading, visibility policies, and global audio button
- License System: Server-side license validation via API with domain-based access control
- TypeScript Support: Full TypeScript definitions and type safety
- Modern Web APIs: Built for modern browsers with ES modules (ESM), CommonJS (CJS), and UMD support
- Performance Optimized: Intelligent caching, preloading, memory management, and file checksum validation
- Accessibility: Built-in accessibility features and responsive design
- API Integration: Built-in API client for server communication and file retrieval from cloud storage
- Component Library: Pre-built React components for audio menu and global audio controls
📁 Project Structure
next-sdk/
├── src/ # JavaScript/TypeScript source code
│ ├── components/ # React/UI components
│ ├── localization/ # Localization messages
│ ├── schemas/ # JSON schemas
│ ├── utils/ # Utility functions
│ └── __tests__/ # Unit and integration tests
├── dist/ # Built packages (ESM, CJS, UMD)
├── examples/
├── tests/
│ ├── compatibility/ # Browser and Node.js compatibility tests
│ └── js/ # JavaScript/TypeScript test utilities
├── docs/ # Documentation
├── scripts/ # Build and utility scripts
├── package.json # NPM package configuration
├── tsconfig.json # TypeScript configuration
├── rollup.config.mjs # Rollup build configuration
└── jest.config.js # Jest test configuration🚀 Installation
JavaScript/TypeScript
npm install @nextsdk/core📖 Documentation
📦 Exports
The SDK exports the following modules and types:
Core Classes
NextSdk- Main SDK classEncryptionService- Encryption/decryption serviceSdkApiClient- API client for server communicationContentParser- Content parsing utilitiesStyleUtils- Style utility functions
Audio System
AudioController- Audio playback controllerPageVisibilityAudio- Page visibility audio managementGlobalAudioConfigManager- Global audio configuration managerGlobalAudioButtonManager- Global audio button managerGlobalAudioButton- Global audio button componentAudioMenu- Audio menu component
Utilities
log- Logger utilitycreateError- Error creation utility
Types
All TypeScript types are exported for type safety and IntelliSense support.
🔐 License
Paid license required for commercial use. See NEXT Dashboard to obtain a license.
🛠️ Development
Prerequisites
- Node.js 20+
- npm 8+
Quick Start
# Install dependencies
npm ci
# Run tests
npm test
# Build package
npm run buildFull Development Setup
# Install SDK dependencies
npm ci
# Install test dependencies (if tests/js has separate package.json)
cd tests/js && npm ci && cd ../..
# Install example dependencies
cd examples/web && npm ci && cd ../..
# Run all tests
npm test
# Build SDK
npm run build
# Run example
cd examples/web && npm run devAvailable Scripts
npm run build # Build the SDK
npm run build:dev # Build in development mode
npm run dev # Watch mode build
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage
npm run test:integration # Run integration tests
npm run test:integration:security # Run security coordination tests
npm run test:integration:performance # Run performance load tests
npm run test:integration:browser # Run cross-browser tests
npm run test:integration:unauthorized # Run unauthorized access tests
npm run test:integration:all # Run all integration tests
npm run test:compatibility # Run compatibility tests
npm run test:node-versions # Test Node.js version compatibility
npm run lint # Lint code
npm run lint:fix # Fix linting issues
npm run type-check # TypeScript type checking
npm run format # Format code with Prettier
npm run format:check # Check code formatting
npm run analyze # Analyze bundle size
npm run analyze:size # Analyze bundle size details