vg-x07df 0.1.0 → 1.0.3

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.
Files changed (154) hide show
  1. package/README.md +74 -192
  2. package/dist/index.cjs +5270 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +857 -0
  5. package/dist/index.d.ts +857 -0
  6. package/dist/index.mjs +5217 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/livekit/index.cjs +2238 -0
  9. package/dist/livekit/index.cjs.map +1 -0
  10. package/dist/livekit/index.d.cts +273 -0
  11. package/dist/livekit/index.d.ts +273 -0
  12. package/dist/livekit/index.mjs +2212 -0
  13. package/dist/livekit/index.mjs.map +1 -0
  14. package/dist/types-r81TLzkF.d.cts +270 -0
  15. package/dist/types-r81TLzkF.d.ts +270 -0
  16. package/package.json +87 -28
  17. package/.azure-pipelines/publish-public.yml +0 -37
  18. package/.azure-pipelines/publish.yml +0 -39
  19. package/.changeset/README.md +0 -8
  20. package/.changeset/config.json +0 -11
  21. package/AUTO_JOIN_GUIDE.md +0 -411
  22. package/Screenshot 2025-09-24 at 14.34.48.png +0 -0
  23. package/Screenshot 2025-10-04 at 12.58.54.png +0 -0
  24. package/biome.json +0 -48
  25. package/examples/demo/.env.example +0 -19
  26. package/examples/demo/CHANGELOG.md +0 -22
  27. package/examples/demo/README.md +0 -72
  28. package/examples/demo/eslint.config.js +0 -23
  29. package/examples/demo/index.html +0 -13
  30. package/examples/demo/package.json +0 -34
  31. package/examples/demo/pnpm-lock.yaml +0 -2098
  32. package/examples/demo/pnpm-workspace.yaml +0 -1
  33. package/examples/demo/public/vite.svg +0 -1
  34. package/examples/demo/src/App.css +0 -52
  35. package/examples/demo/src/App.tsx +0 -176
  36. package/examples/demo/src/assets/react.svg +0 -1
  37. package/examples/demo/src/components/auth/LoginForm.css +0 -144
  38. package/examples/demo/src/components/auth/LoginForm.tsx +0 -80
  39. package/examples/demo/src/components/calling/AutoJoinSettings.tsx +0 -213
  40. package/examples/demo/src/components/calling/AutoJoinStatus.tsx +0 -72
  41. package/examples/demo/src/components/calling/CallInitiator.css +0 -258
  42. package/examples/demo/src/components/calling/CallInitiator.tsx +0 -142
  43. package/examples/demo/src/components/calling/CallNotifications.css +0 -119
  44. package/examples/demo/src/components/calling/CallNotifications.tsx +0 -108
  45. package/examples/demo/src/components/calling/IncomingCallModal.css +0 -192
  46. package/examples/demo/src/components/calling/IncomingCallModal.tsx +0 -78
  47. package/examples/demo/src/components/calling/MinimizedCall.css +0 -156
  48. package/examples/demo/src/components/calling/MinimizedCall.tsx +0 -78
  49. package/examples/demo/src/components/conference/ConferenceHeader.css +0 -265
  50. package/examples/demo/src/components/conference/ConferenceHeader.tsx +0 -78
  51. package/examples/demo/src/components/conference/EnhancedControlBar.css +0 -356
  52. package/examples/demo/src/components/conference/EnhancedControlBar.tsx +0 -262
  53. package/examples/demo/src/components/conference/PaginationControls.css +0 -67
  54. package/examples/demo/src/components/conference/PaginationControls.tsx +0 -64
  55. package/examples/demo/src/components/conference/ParticipantGrid.css +0 -153
  56. package/examples/demo/src/components/conference/ParticipantGrid.tsx +0 -87
  57. package/examples/demo/src/components/conference/ParticipantTile.css +0 -210
  58. package/examples/demo/src/components/conference/ParticipantTile.tsx +0 -114
  59. package/examples/demo/src/components/conference/VideoConference.css +0 -214
  60. package/examples/demo/src/components/conference/VideoConference.tsx +0 -93
  61. package/examples/demo/src/contexts/AuthContext.tsx +0 -105
  62. package/examples/demo/src/hooks/useAuth.ts +0 -5
  63. package/examples/demo/src/hooks/useCallTimer.ts +0 -42
  64. package/examples/demo/src/index.css +0 -68
  65. package/examples/demo/src/main.tsx +0 -10
  66. package/examples/demo/src/services/auth.service.ts +0 -153
  67. package/examples/demo/src/types/auth.types.ts +0 -31
  68. package/examples/demo/tsconfig.app.json +0 -28
  69. package/examples/demo/tsconfig.json +0 -7
  70. package/examples/demo/tsconfig.node.json +0 -26
  71. package/examples/demo/vite.config.ts +0 -15
  72. package/images/callpad-without-ai.png +0 -0
  73. package/packages/sdk/README.md +0 -97
  74. package/packages/sdk/documentation.md +0 -1132
  75. package/packages/sdk/openapi-ts.config.ts +0 -7
  76. package/packages/sdk/package.json +0 -88
  77. package/packages/sdk/src/core/auth.manager.ts +0 -52
  78. package/packages/sdk/src/core/events/event-bus.ts +0 -301
  79. package/packages/sdk/src/core/events/index.ts +0 -8
  80. package/packages/sdk/src/core/events/types.ts +0 -165
  81. package/packages/sdk/src/core/index.ts +0 -3
  82. package/packages/sdk/src/core/signal/api.config.ts +0 -49
  83. package/packages/sdk/src/core/signal/index.ts +0 -16
  84. package/packages/sdk/src/core/signal/signal.client.ts +0 -101
  85. package/packages/sdk/src/core/signal/types.ts +0 -110
  86. package/packages/sdk/src/core/socketio/handlers/base.handler.ts +0 -212
  87. package/packages/sdk/src/core/socketio/handlers/call-accepted.handler.ts +0 -34
  88. package/packages/sdk/src/core/socketio/handlers/call-canceled.handler.ts +0 -34
  89. package/packages/sdk/src/core/socketio/handlers/call-declined.handler.ts +0 -29
  90. package/packages/sdk/src/core/socketio/handlers/call-ended.handler.ts +0 -40
  91. package/packages/sdk/src/core/socketio/handlers/call-incoming.handler.ts +0 -72
  92. package/packages/sdk/src/core/socketio/handlers/call-join-info.handler.ts +0 -181
  93. package/packages/sdk/src/core/socketio/handlers/call-participant-joined.handler.ts +0 -42
  94. package/packages/sdk/src/core/socketio/handlers/call-participant-joining.handler.ts +0 -42
  95. package/packages/sdk/src/core/socketio/handlers/call-timeout.handler.ts +0 -31
  96. package/packages/sdk/src/core/socketio/handlers/handler.registry.ts +0 -62
  97. package/packages/sdk/src/core/socketio/handlers/index.ts +0 -21
  98. package/packages/sdk/src/core/socketio/handlers/participant-left.handler.ts +0 -37
  99. package/packages/sdk/src/core/socketio/handlers/schema.ts +0 -130
  100. package/packages/sdk/src/core/socketio/index.ts +0 -5
  101. package/packages/sdk/src/core/socketio/socket.manager.ts +0 -187
  102. package/packages/sdk/src/core/socketio/types.ts +0 -14
  103. package/packages/sdk/src/core/types.ts +0 -23
  104. package/packages/sdk/src/generated/api/core/ApiError.ts +0 -21
  105. package/packages/sdk/src/generated/api/core/ApiRequestOptions.ts +0 -13
  106. package/packages/sdk/src/generated/api/core/ApiResult.ts +0 -7
  107. package/packages/sdk/src/generated/api/core/CancelablePromise.ts +0 -126
  108. package/packages/sdk/src/generated/api/core/OpenAPI.ts +0 -55
  109. package/packages/sdk/src/generated/api/core/request.ts +0 -339
  110. package/packages/sdk/src/generated/api/index.ts +0 -5
  111. package/packages/sdk/src/generated/api/models.ts +0 -219
  112. package/packages/sdk/src/generated/api/services.ts +0 -225
  113. package/packages/sdk/src/hooks/index.ts +0 -21
  114. package/packages/sdk/src/hooks/useAutoJoin.ts +0 -66
  115. package/packages/sdk/src/hooks/useCallActions.ts +0 -28
  116. package/packages/sdk/src/hooks/useCallQuality.ts +0 -416
  117. package/packages/sdk/src/hooks/useCallState.ts +0 -23
  118. package/packages/sdk/src/hooks/useConnection.ts +0 -15
  119. package/packages/sdk/src/hooks/useDevices.ts +0 -296
  120. package/packages/sdk/src/hooks/useErrorRecovery.ts +0 -299
  121. package/packages/sdk/src/hooks/useErrors.ts +0 -84
  122. package/packages/sdk/src/hooks/useEvent.ts +0 -188
  123. package/packages/sdk/src/hooks/useMediaControls.ts +0 -215
  124. package/packages/sdk/src/hooks/useParticipantStatus.ts +0 -318
  125. package/packages/sdk/src/hooks/useParticipants.ts +0 -111
  126. package/packages/sdk/src/index.ts +0 -66
  127. package/packages/sdk/src/livekit/constants.ts +0 -76
  128. package/packages/sdk/src/livekit/device.manager.ts +0 -172
  129. package/packages/sdk/src/livekit/error-classifier.ts +0 -155
  130. package/packages/sdk/src/livekit/events/eventBridge.ts +0 -371
  131. package/packages/sdk/src/livekit/events/trackRegistry.ts +0 -114
  132. package/packages/sdk/src/livekit/index.ts +0 -49
  133. package/packages/sdk/src/livekit/livekit.service.ts +0 -110
  134. package/packages/sdk/src/livekit/media.controls.ts +0 -315
  135. package/packages/sdk/src/livekit/room.manager.ts +0 -79
  136. package/packages/sdk/src/livekit/track.utils.ts +0 -230
  137. package/packages/sdk/src/livekit/types.ts +0 -135
  138. package/packages/sdk/src/provider/RtcProvider.tsx +0 -78
  139. package/packages/sdk/src/services/call-actions.ts +0 -260
  140. package/packages/sdk/src/services/error-recovery.ts +0 -461
  141. package/packages/sdk/src/services/index.ts +0 -2
  142. package/packages/sdk/src/services/sdk-builder.ts +0 -104
  143. package/packages/sdk/src/state/errors.ts +0 -163
  144. package/packages/sdk/src/state/selectors.ts +0 -28
  145. package/packages/sdk/src/state/store.ts +0 -36
  146. package/packages/sdk/src/state/types.ts +0 -151
  147. package/packages/sdk/src/utils/logger.ts +0 -183
  148. package/packages/sdk/tsconfig.json +0 -49
  149. package/packages/sdk/tsup.config.ts +0 -51
  150. package/pnpm-workspace.yaml +0 -4
  151. package/tsconfig.base.json +0 -19
  152. package/turbo.json +0 -34
  153. /package/{packages/sdk/CHANGELOG.md → CHANGELOG.md} +0 -0
  154. /package/{packages/sdk/LICENSE → LICENSE} +0 -0
package/README.md CHANGED
@@ -1,215 +1,97 @@
1
- # CallPad Web SDK
1
+ # CallPad SDK
2
2
 
3
- A Turborepo monorepo containing the CallPad Web SDK and related packages.
3
+ Production-ready headless SDK for CallPad audio/video calls with React integration.
4
4
 
5
- ## Project Structure
6
-
7
- This monorepo includes the following packages:
8
-
9
- ### Packages
10
-
11
- - `packages/sdk` - CallPad SDK (`vg-x07df`) - Production-ready headless SDK for CallPad audio/video calls
12
- - `examples/demo` - Demo application showcasing CallPad SDK features
13
-
14
- ### Tools & Configuration
15
-
16
- - **Turborepo** for build orchestration and monorepo management
17
- - **pnpm** as the package manager
18
- - **TypeScript** for type checking
19
- - **Biome** for code linting and formatting
20
- - **Changesets** for version management and publishing
21
-
22
- ## Getting Started
23
-
24
- ### Prerequisites
25
-
26
- - Node.js ≥18
27
- - pnpm ≥9.0.0
28
-
29
- ### Installation
5
+ ## Installation
30
6
 
31
7
  ```bash
32
- # Install dependencies
33
- pnpm install
34
-
35
- # Build all packages
36
- pnpm build
37
-
38
- # Run type checking
39
- pnpm check-types
40
-
41
- # Run linting
42
- pnpm lint
8
+ npm install vg-x07df
9
+ # or
10
+ yarn add vg-x07df
11
+ # or
12
+ pnpm add vg-x07df
43
13
  ```
44
14
 
45
- ### Development
46
-
47
- ```bash
48
- # Start development mode
49
- pnpm dev
50
-
51
- # Start development for SDK only
52
- pnpm dev --filter=vg-x07df
53
-
54
- # Start demo application
55
- pnpm dev --filter=callpad-demo
15
+ ## Quick Start
16
+
17
+ ```tsx
18
+ import { CallpadSdkProvider, useCallActions, useCallState } from 'vg-x07df';
19
+
20
+ function App() {
21
+ return (
22
+ <CallpadSdkProvider config={{ apiUrl: 'your-api-url' }}>
23
+ <CallInterface />
24
+ </CallpadSdkProvider>
25
+ );
26
+ }
27
+
28
+ function CallInterface() {
29
+ const { initiate, accept, end } = useCallActions();
30
+ const { status, participants } = useCallState();
31
+
32
+ const handleStartCall = () => {
33
+ initiate(['user@example.com'], 'VIDEO');
34
+ };
35
+
36
+ return (
37
+ <div>
38
+ <h1>Call Status: {status}</h1>
39
+ <button onClick={handleStartCall}>Start Video Call</button>
40
+ <div>Participants: {participants.length}</div>
41
+ </div>
42
+ );
43
+ }
56
44
  ```
57
45
 
58
- ### Building
46
+ ## Features
59
47
 
60
- ```bash
61
- # Build all packages
62
- pnpm build
63
-
64
- # Build SDK only
65
- pnpm build --filter=vg-x07df
66
-
67
- # Build with type checking
68
- pnpm build && pnpm check-types
69
- ```
48
+ - 🎥 **Audio & Video Calls** - High-quality real-time communication
49
+ - **React Hooks** - Modern React integration with custom hooks
50
+ - 🔧 **Headless UI** - Bring your own UI components
51
+ - 📱 **Responsive** - Works across desktop and mobile
52
+ - 🔒 **Secure** - End-to-end encrypted communications
53
+ - 🎛️ **Media Controls** - Camera, microphone, and screen sharing
54
+ - 👥 **Multi-participant** - Support for group calls
55
+ - 📊 **Call Quality** - Real-time quality monitoring
56
+ - 🔔 **Event System** - Comprehensive call event handling
70
57
 
71
- ## Publishing Packages
58
+ ## API Reference
72
59
 
73
- This project uses [Changesets](https://github.com/changesets/changesets) for version management and publishing. The main publishable package is the CallPad SDK (`vg-x07df`).
60
+ ### Providers
74
61
 
75
- ### Prerequisites for Publishing
62
+ - `CallpadSdkProvider` - Main provider component for SDK configuration
76
63
 
77
- 1. **NPM Authentication**: Ensure you have npm access and authentication configured
78
- ```bash
79
- npm login
80
- # or set NPM_TOKEN in your .env file
81
- ```
64
+ ### Hooks
82
65
 
83
- 2. **Environment Setup**: Create a `.env` file in the root with your npm token:
84
- ```bash
85
- NPM_TOKEN=your_npm_token_here
86
- ```
66
+ - `useCallActions()` - Actions for managing calls (initiate, accept, decline, end, cancel)
67
+ - `useCallState()` - Current call state and session information
68
+ - `useParticipants()` - Participant management and information
69
+ - `useMediaControls()` - Camera, microphone, and screen sharing controls
70
+ - `useDevices()` - Audio/video device selection
71
+ - `useEvent()` - SDK event subscriptions
72
+ - `useCallQuality()` - Real-time call quality metrics
73
+ - `useErrors()` - Error handling and management
87
74
 
88
- ### Publishing Workflow
75
+ ### LiveKit Integration
89
76
 
90
- #### 1. Create a Changeset
77
+ ```tsx
78
+ import { LiveKitProvider, useTrack } from 'vg-x07df/livekit';
91
79
 
92
- When you make changes that should be included in the next release, create a changeset:
93
-
94
- ```bash
95
- # Create a new changeset (interactive)
96
- pnpm changeset
80
+ // Access LiveKit room and tracks directly
81
+ const track = useTrack();
97
82
  ```
98
83
 
99
- This will:
100
- - Prompt you to select which packages to include
101
- - Ask for the type of change (major, minor, patch)
102
- - Request a summary of the changes
103
-
104
- #### 2. Version Packages
105
-
106
- When you're ready to release, update package versions based on changesets:
84
+ ## Requirements
107
85
 
108
- ```bash
109
- # Process changesets and bump versions
110
- pnpm version
111
- ```
112
-
113
- This will:
114
- - Update package.json versions according to changesets
115
- - Update CHANGELOG.md files
116
- - Remove processed changeset files
117
-
118
- #### 3. Publish to npm
119
-
120
- Publish the updated packages:
121
-
122
- ```bash
123
- # Build, type-check, and publish to npm
124
- pnpm publish
125
-
126
- # Or test the publishing process first
127
- pnpm publish:dry
128
- ```
129
-
130
- This command:
131
- - Builds only the SDK package (`--filter=vg-x07df`)
132
- - Runs type checking to ensure code quality
133
- - Publishes to npm registry with proper authentication
134
-
135
- ### Changeset Types
136
-
137
- - **Patch** (`1.0.0 → 1.0.1`): Bug fixes, small updates
138
- - **Minor** (`1.0.0 → 1.1.0`): New features, backward-compatible changes
139
- - **Major** (`1.0.0 → 2.0.0`): Breaking changes
140
-
141
- ### Example Publishing Flow
142
-
143
- ```bash
144
- # 1. Make your changes to the SDK
145
- # 2. Create a changeset
146
- pnpm changeset
147
- # Select packages: vg-x07df
148
- # Change type: patch/minor/major
149
- # Summary: "Add new useCallQuality hook"
150
-
151
- # 3. Commit your changes
152
- git add .
153
- git commit -m "feat: add useCallQuality hook"
154
-
155
- # 4. When ready to release, process changesets
156
- pnpm version
157
-
158
- # 5. Publish to npm
159
- pnpm publish
160
-
161
- # 6. Push the version changes
162
- git push && git push --tags
163
- ```
164
-
165
- ### CI/CD Publishing
166
-
167
- The Azure pipeline (`.azure-pipelines/publish.yml`) automatically publishes when:
168
- - Changes are pushed to the `main` branch
169
- - The `NPM_TOKEN` environment variable is configured in Azure DevOps
170
-
171
- ### Remote Caching
172
-
173
- > [!TIP]
174
- > Vercel Remote Cache is free for all plans. Get started today at [vercel.com](https://vercel.com/signup?/signup?utm_source=remote-cache-sdk&utm_campaign=free_remote_cache).
175
-
176
- Turborepo can use a technique known as [Remote Caching](https://turborepo.com/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
177
-
178
- By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup?utm_source=turborepo-examples), then enter the following commands:
179
-
180
- ```
181
- cd my-turborepo
182
-
183
- # With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
184
- turbo login
185
-
186
- # Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
187
- npx turbo login
188
- yarn exec turbo login
189
- pnpm exec turbo login
190
- ```
191
-
192
- This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
193
-
194
- Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
195
-
196
- ```
197
- # With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)
198
- turbo link
199
-
200
- # Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager
201
- npx turbo link
202
- yarn exec turbo link
203
- pnpm exec turbo link
204
- ```
86
+ - React ≥18.0.0
87
+ - React DOM ≥18.0.0
88
+ - LiveKit Client ≥2.8.0
89
+ - Socket.IO Client ≥4.7.0
205
90
 
206
- ## Useful Links
91
+ ## TypeScript Support
207
92
 
208
- Learn more about the power of Turborepo:
93
+ This package includes full TypeScript definitions. No additional @types packages needed.
209
94
 
210
- - [Tasks](https://turborepo.com/docs/crafting-your-repository/running-tasks)
211
- - [Caching](https://turborepo.com/docs/crafting-your-repository/caching)
212
- - [Remote Caching](https://turborepo.com/docs/core-concepts/remote-caching)
213
- - [Filtering](https://turborepo.com/docs/crafting-your-repository/running-tasks#using-filters)
214
- - [Configuration Options](https://turborepo.com/docs/reference/configuration)
215
- - [CLI Usage](https://turborepo.com/docs/reference/command-line-reference)
95
+ ```tsx
96
+ import type { CallState, Participant, CallQuality } from 'vg-x07df';
97
+ ```