@bytexbyte/nxtlinq-ai-agent-sdk
v1.6.29
Published
Nxtlinq AI Agent SDK - Proprietary Software with enhanced async operation handling
Readme
nxtlinq AI Agent SDK
A comprehensive SDK for integrating AI agents with wallet verification capabilities, speech-to-text functionality, and responsive mobile design.
Features
- 🤖 AI-powered chat interface with multiple model support
- 🔐 Built-in BerifyMe wallet verification
- 🎤 Speech-to-text voice input with Microsoft Cognitive Services
- 🎨 Customizable UI components with responsive design
- 🔧 Tool integration support
- 📱 Mobile-optimized responsive design (65-70% viewport on mobile)
- 👤 Custom user identity support
- ⏰ Configurable banner dismiss duration
- 🎯 Multiple AI model support
- 💾 Flexible storage options (localStorage/sessionStorage)
- 🔄 Semi-automatic mode for user activation
Installation
npm install @bytexbyte/nxtlinq-ai-agent-sdk
# or
yarn add @bytexbyte/nxtlinq-ai-agent-sdkQuick Start
Basic Usage
import { ChatBot } from '@bytexbyte/nxtlinq-ai-agent-sdk';
function App() {
return (
<ChatBot
serviceId="your-service-id"
apiKey="your-api-key"
apiSecret="your-api-secret"
/>
);
}With Built-in BerifyMe Support
The SDK includes built-in BerifyMe wallet verification for seamless integration:
import { ChatBot } from '@bytexbyte/nxtlinq-ai-agent-sdk';
function App() {
return (
<ChatBot
serviceId="your-service-id"
apiKey="your-api-key"
apiSecret="your-api-secret"
// requireWalletIDVVerification defaults to true - wallet verification is required
/>
);
}With Speech-to-Text Support
Enable voice input with Microsoft Cognitive Services:
<ChatBot
serviceId="your-service-id"
apiKey="your-api-key"
apiSecret="your-api-secret"
isStopRecordingOnSend={true} // Stop recording automatically when sending message
/>Skip Wallet Verification Check
Allow users to set AIT permissions without wallet verification:
<ChatBot
serviceId="your-service-id"
apiKey="your-api-key"
apiSecret="your-api-secret"
requireWalletIDVVerification={false} // Skip wallet IDV verification check
/>Mobile Responsive Design
The SDK is optimized for mobile devices with responsive breakpoints:
- Tablet (≤768px): Chat window sized to 70% viewport width/height
- Mobile (≤480px): Chat window sized to 65% viewport width/height
- PermissionForm: Responsive sizing with 75% width on tablet, 70% on mobile
- Floating Button: Optimized positioning and sizing for touch interfaces
- Browser Compatibility: Accounts for mobile browser address bars and UI elements
Configuration Options
Core Configuration
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| serviceId | string | - | Required - Your service ID |
| apiKey | string | - | Required - Your API key |
| apiSecret | string | - | Required - Your API secret |
Wallet Verification Options
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| requireWalletIDVVerification | boolean | true | Whether to check wallet IDV verification status before AIT operations |
| customUsername | string | - | Custom username for wallet verification when using custom method |
| idvBannerDismissSeconds | number | 86400 | Seconds to hide IDV suggestion banner after user dismisses it (default: 24 hours) |
| berifymeMode | 'built-in' \| 'external' | 'built-in' | BerifyMe integration mode |
AI Model Configuration
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| availableModels | AIModel[] | DEFAULT_AI_MODELS | Available AI models for selection |
| defaultModelIndex | number | 0 | Default selected model index |
| showModelSelector | boolean | true | Whether to show model selector in UI |
| onModelChange | (model: AIModel) => void | - | Callback when model is changed |
Storage Configuration
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| useSessionStorage | boolean | false | Use sessionStorage instead of localStorage for chat state |
User Identity Options
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| customUserInfo | Record<string, any> | - | Custom user identity information object for backend processing |
Speech-to-Text Options
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| isStopRecordingOnSend | boolean | false | Stop recording automatically when sending message |
Advanced Options
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| isSemiAutomaticMode | boolean | false | Enable semi-automatic mode for user activation |
| maxRetries | number | 3 | Maximum retry attempts for failed requests |
| retryDelay | number | 1000 | Delay between retry attempts (ms) |
Available AI Models
The SDK supports multiple AI models:
- Claude (
claude) - ChatGPT (
open-ai) - Llama (
llama) - Gemini (
gemini) - Nova (
nova)
Configuration Examples
Complete Configuration Example
<ChatBot
serviceId="your-service-id"
apiKey="your-api-key"
apiSecret="your-api-secret"
// Wallet verification
requireWalletIDVVerification={false}
customUsername="john.doe"
idvBannerDismissSeconds={3600}
berifymeMode="built-in"
// AI models
availableModels={DEFAULT_AI_MODELS}
defaultModelIndex={0}
showModelSelector={true}
onModelChange={(model) => console.log('Model changed:', model)}
// Storage
useSessionStorage={true}
// User identity
customUserInfo={{
corpId: "CORP-001",
department: "Engineering",
role: "Developer"
}}
// Speech-to-text
isStopRecordingOnSend={true}
// Advanced
isSemiAutomaticMode={false}
maxRetries={3}
retryDelay={1000}
// Callbacks
onMessage={(message) => console.log('New message:', message)}
onError={(error) => console.error('Error:', error)}
onToolUse={async (toolUse) => {
// Handle tool use
return { text: 'Tool executed successfully' };
}}
/>Custom AI Models
import { ChatBot, AIModel } from '@bytexbyte/nxtlinq-ai-agent-sdk';
const customModels: AIModel[] = [
{ label: 'Claude', value: 'claude' },
{ label: 'ChatGPT', value: 'open-ai' },
{ label: 'Llama', value: 'llama' },
{ label: 'Gemini', value: 'gemini' }
];
<ChatBot
serviceId="your-service-id"
apiKey="your-api-key"
apiSecret="your-api-secret"
availableModels={customModels}
defaultModelIndex={0}
/>Advanced Features
Speech-to-Text Integration
The SDK includes built-in speech-to-text functionality using Microsoft Cognitive Services:
- Real-time transcription: Live voice-to-text conversion
- Partial transcripts: Shows real-time partial results while speaking
- Wake lock support: Prevents screen from sleeping during recording
- Automatic cleanup: Handles microphone permissions and cleanup
- Configurable behavior: Control when recording stops
IDV Suggestion Banner
When requireWalletIDVVerification: false, the SDK shows a helpful suggestion banner for unverified wallets:
- Smart Timing: 1-second delay prevents flashing during wallet connection
- Configurable Dismissal: Users can dismiss the banner for a customizable duration (default: 24 hours)
- Persistent State: Dismissal preference is saved in localStorage
- Responsive Design: Banner adapts to different screen sizes
- User-Friendly Display: Shows time in hours/minutes format (e.g., "24h" or "1h 30m")
Custom User Identity
The SDK supports flexible user identity information for enhanced backend processing:
- Custom Username: Set a custom username for wallet verification using the
custommethod - Flexible User Info: Pass additional user data via
customUserInfoobject for backend processing - Backend Integration: Custom identity information is sent to the AIT Service for processing
- Optional Parameters: Both
customUsernameandcustomUserInfoare optional
Storage Modes
Choose between different storage strategies:
- localStorage (default): Persistent across browser sessions
- sessionStorage: Data cleared when browser tab is closed
BerifyMe Integration Modes
- built-in (default): SDK automatically loads and manages BerifyMe
- external: Use your own BerifyMe integration with
onVerifyWalletcallback
Exported Components and Utilities
Components
import {
ChatBot,
ChatBotUI,
MessageInput,
MessageList,
ModelSelector,
NotificationModal,
PermissionForm,
PresetMessages,
BerifyMeModal
} from '@bytexbyte/nxtlinq-ai-agent-sdk';Hooks and Context
import {
ChatBotProvider,
useChatBot,
useLocalStorage,
useSessionStorage
} from '@bytexbyte/nxtlinq-ai-agent-sdk';Utilities
import {
connectWallet,
disconnectWallet,
validateToken,
createAITMetadata,
generateAITId,
prepareAITCreation,
createNotification,
getNotificationIcon,
containsUrls,
convertUrlsToLinks,
convertUrlsToHtml,
createNxtlinqApi
} from '@bytexbyte/nxtlinq-ai-agent-sdk';Types
import type {
ChatBotProps,
ChatBotContextType,
AIModel,
AITMetadata,
NovaResponse,
NovaError,
PresetMessage,
ToolCall,
ToolUse,
AIT,
AITApi,
Message,
ServicePermission
} from '@bytexbyte/nxtlinq-ai-agent-sdk';Benefits
✅ Always Available: Built-in BerifyMe support is always enabled - no configuration needed!
✅ No onVerifyWallet Needed: SDK automatically handles wallet verification - no callback implementation required
✅ Simplified Integration: No need to manually handle DOM manipulation, React roots, or modal lifecycle
✅ Automatic SDK Loading: SDK automatically loads BerifyMe dependencies when needed
✅ Built-in Error Handling: Comprehensive error handling and fallback mechanisms
✅ Consistent UI: Unified modal experience across all implementations
✅ Easy Configuration: Simple configuration object with sensible defaults
✅ Automatic Cleanup: Modal cleanup and memory management handled automatically
✅ Flexible IDV Verification: Control whether to require wallet IDV verification before AIT operations
✅ Smart Suggestion Banner: When verification is optional, shows helpful suggestion banner with 1-second delay to prevent flashing
✅ Custom User Identity: Support for custom usernames and flexible user information objects
✅ Configurable Banner Duration: Customize how long the IDV suggestion banner stays hidden after dismissal
✅ Mobile Optimized: Responsive design that works perfectly on mobile devices with optimized dimensions
✅ Speech-to-Text: Built-in voice input with Microsoft Cognitive Services integration
✅ Multiple AI Models: Support for various AI models (Claude, ChatGPT, Llama, Gemini, Nova)
✅ Flexible Storage: Choose between localStorage and sessionStorage for different use cases
Support
For questions and support, please refer to the SDK documentation or contact the development team.
