@anganyai/voice-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to
7
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ ## [Unreleased]
10
+
11
+ ### Added
12
+
13
+ - Initial SDK structure and TypeScript setup
14
+ - Core authentication module with Frontend, Backend, and Service Account
15
+ patterns
16
+ - Conversation management with real-time transcriptions
17
+ - Platform-specific implementations for Web, Node.js, and React Native
18
+ - Comprehensive type definitions
19
+ - Enterprise-grade tooling (oxlint, knip, prettier, vitest)
20
+ - Documentation generation with TypeDoc
21
+ - E2E testing setup with Playwright
22
+ - Automated release management with changesets
23
+
24
+ ### Security
25
+
26
+ - Secure OAuth2/OIDC authentication flows
27
+ - Dynamic client registration for backend auth
28
+
29
+ ## [0.0.1] - 2025-01-20
30
+
31
+ ### Added
32
+
33
+ - Initial release (pre-alpha)
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Angany AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ # Angany Voice SDK
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@angany/voice-sdk.svg)](https://www.npmjs.com/package/@angany/voice-sdk)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)
6
+ [![Documentation](https://img.shields.io/badge/docs-typedoc-blue.svg)](https://angany.github.io/voice-sdk)
7
+
8
+ Enterprise-grade SDK for building AI-powered voice conversations with Angany.
9
+
10
+ ## Features
11
+
12
+ - 🎙️ **Real-time Voice Conversations** - Natural, low-latency voice interactions
13
+ - 🔐 **Enterprise Authentication** - Multiple auth patterns (Frontend, Backend,
14
+ Service Account)
15
+ - 🌐 **Cross-Platform** - Works on Web, Node.js, and React Native
16
+ - 📝 **Live Transcriptions** - Real-time speech-to-text with speaker attribution
17
+ - 🔄 **Automatic Reconnection** - Resilient connection handling
18
+ - 📊 **Quality Monitoring** - Built-in connection quality metrics
19
+ - 🎛️ **Advanced Audio Controls** - Echo cancellation, noise suppression, AGC
20
+ - 🏗️ **TypeScript First** - Full type safety and IntelliSense support
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ npm install @angany/voice-sdk
26
+ # or
27
+ yarn add @angany/voice-sdk
28
+ # or
29
+ pnpm add @angany/voice-sdk
30
+ ```
31
+
32
+ ## Quick Start
33
+
34
+ ```typescript
35
+ import { AnganyVoice } from '@angany/voice-sdk';
36
+
37
+ // Initialize the SDK
38
+ const voice = new AnganyVoice({
39
+ apiUrl: 'https://api.angany.ai',
40
+ debug: true,
41
+ });
42
+
43
+ // Authenticate (Frontend flow)
44
+ await voice.auth.authenticateFrontend();
45
+
46
+ // Start a conversation
47
+ const conversation = await voice.startConversation('customer-support');
48
+
49
+ // Listen to transcriptions
50
+ conversation.on('transcription', (event) => {
51
+ console.log(`${event.role}: ${event.text}`);
52
+ });
53
+
54
+ // Send a message to the AI
55
+ await conversation.speak('Hello, I need help with my account');
56
+ ```
57
+
58
+ ## Documentation
59
+
60
+ - [Architecture Guide](./docs/architecture.md)
61
+ - [API Reference](./docs/api/README.md)
62
+ - [Security Policy](./SECURITY.md)
63
+ - [Quick Start Guide](./QUICK_START.md)
64
+
65
+ ## Platform Support
66
+
67
+ ### Web
68
+
69
+ ```typescript
70
+ import { AnganyVoice } from '@angany/voice-sdk/web';
71
+ ```
72
+
73
+ ### Node.js
74
+
75
+ ```typescript
76
+ import { AnganyVoice } from '@angany/voice-sdk/node';
77
+ ```
78
+
79
+ ### React Native
80
+
81
+ ```typescript
82
+ import { AnganyVoice } from '@angany/voice-sdk/react-native';
83
+ ```
84
+
85
+ ## Authentication
86
+
87
+ The SDK supports multiple authentication patterns:
88
+
89
+ ### Frontend Authentication
90
+
91
+ Best for SPAs and web applications:
92
+
93
+ ```typescript
94
+ await voice.auth.authenticateFrontend({
95
+ redirectUri: 'https://app.example.com/callback',
96
+ });
97
+ ```
98
+
99
+ ### Backend Authentication
100
+
101
+ For server-side applications:
102
+
103
+ ```typescript
104
+ const { authUrl } = await voice.auth.authenticateBackend({
105
+ branding: {
106
+ applicationName: 'My App',
107
+ applicationIcon: 'https://example.com/icon.png',
108
+ },
109
+ });
110
+ // Redirect user to authUrl
111
+ ```
112
+
113
+ ### Service Account
114
+
115
+ For machine-to-machine communication:
116
+
117
+ ```typescript
118
+ await voice.auth.authenticateServiceAccount({
119
+ credentials: {
120
+ clientId: process.env.CLIENT_ID,
121
+ clientSecret: process.env.CLIENT_SECRET,
122
+ },
123
+ });
124
+ ```
125
+
126
+ ## Examples
127
+
128
+ ### Handle Connection States
129
+
130
+ ```typescript
131
+ conversation.on('stateChange', (state, previousState) => {
132
+ console.log(`State changed from ${previousState} to ${state}`);
133
+ });
134
+
135
+ conversation.on('error', (error) => {
136
+ console.error('Conversation error:', error);
137
+ });
138
+ ```
139
+
140
+ ### Monitor Connection Quality
141
+
142
+ ```typescript
143
+ conversation.on('qualityChange', (quality) => {
144
+ console.log(`Connection quality: ${quality.level} (${quality.score}/100)`);
145
+ });
146
+ ```
147
+
148
+ ### Mute/Unmute
149
+
150
+ ```typescript
151
+ // Mute the user's microphone
152
+ await conversation.muteUser();
153
+
154
+ // Mute the AI agent
155
+ await conversation.muteAgent();
156
+ ```
157
+
158
+ ## Development
159
+
160
+ ```bash
161
+ # Install dependencies
162
+ pnpm install
163
+
164
+ # Run tests
165
+ pnpm test
166
+
167
+ # Build the SDK
168
+ pnpm build
169
+
170
+ # Run linting
171
+ pnpm lint
172
+
173
+ # Check for unused code
174
+ pnpm knip
175
+ ```
176
+
177
+ ## Contributing
178
+
179
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md)
180
+ for details.
181
+
182
+ ## License
183
+
184
+ MIT © Angany AI
185
+
186
+ ## Support
187
+
188
+ - 📧 Email: sdk@angany.ai
189
+ - 💬 Discord: [Join our community](https://discord.gg/angany)
190
+ - 🐛 Issues: [GitHub Issues](https://github.com/angany/voice-sdk/issues)
191
+
192
+ ---
193
+
194
+ <p align="center">
195
+ Built with ❤️ by <a href="https://angany.ai">Angany AI</a>
196
+ </p>
197
+
198
+ <p align="center">
199
+ <a href="https://angany.ai/docs">Docs</a> •
200
+ <a href="https://angany.ai/examples">Examples</a> •
201
+ <a href="https://angany.ai/discord">Discord</a> •
202
+ <a href="https://angany.ai/blog">Blog</a>
203
+ </p>