@smartlink-sdk/core-spec
v1.0.0
Published
Core types and utilities for SmartLink SDK
Downloads
48
Readme
@smartlink-sdk/core-spec
Shared types, error model, and configuration validation for the SmartLink SDK.
Overview
This package defines the contracts shared across all SmartLink SDK platform implementations:
- Types:
SmartLinkConfig,SmartLinkParams,SmartLinkResult,SmartLinkIntent,IntegrationReport,EventPlatform - Errors:
SmartLinkErrorwith typed error codes (INVALID_CONFIG,INVALID_PARAMS,API_ERROR,NETWORK_ERROR,NOT_INITIALIZED) - Validation:
validateConfig()for SDK configuration
Installation
npm install @smartlink-sdk/core-specThis package is a dependency of @smartlink-sdk/react-native and is installed automatically. You typically don't need to install it directly unless building a custom platform SDK.
Usage
import type { SmartLinkConfig, SmartLinkIntent } from '@smartlink-sdk/core-spec';
import { SmartLinkError, validateConfig } from '@smartlink-sdk/core-spec';
const config: SmartLinkConfig = {
apiKey: 'YOUR_API_KEY_HERE',
baseUrl: 'https://sl.ahatools.work',
};
validateConfig(config); // throws SmartLinkError if invalidLicense
MIT
