MACHHUB TypeScript SDK

@machhub-dev/sdk-ts v1.0.0 MIT License TypeScript

Installation

Quick Start

Recommended Setup (Singleton Pattern)

Initialize the SDK once using the singleton pattern for production applications

Configuration

MACHHUB Designer Extension

Configure the SDK using MACHHUB Designer Extension for VS Code

Note: Ensure the MACHHUB Designer Extension is installed and configured in your VS Code workspace before using this method.

Architecture Patterns

SDK Singleton Service

Initialize once, use everywhere

Relation Fields

Working with Relation Fields

All record fields follow the same format pattern

Core Features

Authentication

User management and access control

Collections

Database operations with querying capabilities

Tags

Real-time tag management and subscription

Historian

Historical data retrieval and analysis

API Reference

Core SDK Methods

Initialize and configure the SDK

Initializes the SDK with the provided configuration.

Examples

Complete Real-time Monitoring System

Production-ready example using singleton pattern and service layer

Error Handling

Comprehensive Error Handling

Always wrap SDK calls in try-catch blocks for robust applications

Best Practices

Initialization
Authentication State
Query Building
Real-time Data

TypeScript Support

Type Inference

Automatic type inference for collection operations

Generic Type Safety

Type-safe service methods with generics

Operator Type Safety

Compile-time validation for query operators

IDE Autocomplete

Full IntelliSense support for all SDK methods

Support & Resources

MACHHUB SDK - Empowering Industrial IoT Integrations