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.
- package/README.md +74 -192
- package/dist/index.cjs +5270 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +857 -0
- package/dist/index.d.ts +857 -0
- package/dist/index.mjs +5217 -0
- package/dist/index.mjs.map +1 -0
- package/dist/livekit/index.cjs +2238 -0
- package/dist/livekit/index.cjs.map +1 -0
- package/dist/livekit/index.d.cts +273 -0
- package/dist/livekit/index.d.ts +273 -0
- package/dist/livekit/index.mjs +2212 -0
- package/dist/livekit/index.mjs.map +1 -0
- package/dist/types-r81TLzkF.d.cts +270 -0
- package/dist/types-r81TLzkF.d.ts +270 -0
- package/package.json +87 -28
- package/.azure-pipelines/publish-public.yml +0 -37
- package/.azure-pipelines/publish.yml +0 -39
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/AUTO_JOIN_GUIDE.md +0 -411
- package/Screenshot 2025-09-24 at 14.34.48.png +0 -0
- package/Screenshot 2025-10-04 at 12.58.54.png +0 -0
- package/biome.json +0 -48
- package/examples/demo/.env.example +0 -19
- package/examples/demo/CHANGELOG.md +0 -22
- package/examples/demo/README.md +0 -72
- package/examples/demo/eslint.config.js +0 -23
- package/examples/demo/index.html +0 -13
- package/examples/demo/package.json +0 -34
- package/examples/demo/pnpm-lock.yaml +0 -2098
- package/examples/demo/pnpm-workspace.yaml +0 -1
- package/examples/demo/public/vite.svg +0 -1
- package/examples/demo/src/App.css +0 -52
- package/examples/demo/src/App.tsx +0 -176
- package/examples/demo/src/assets/react.svg +0 -1
- package/examples/demo/src/components/auth/LoginForm.css +0 -144
- package/examples/demo/src/components/auth/LoginForm.tsx +0 -80
- package/examples/demo/src/components/calling/AutoJoinSettings.tsx +0 -213
- package/examples/demo/src/components/calling/AutoJoinStatus.tsx +0 -72
- package/examples/demo/src/components/calling/CallInitiator.css +0 -258
- package/examples/demo/src/components/calling/CallInitiator.tsx +0 -142
- package/examples/demo/src/components/calling/CallNotifications.css +0 -119
- package/examples/demo/src/components/calling/CallNotifications.tsx +0 -108
- package/examples/demo/src/components/calling/IncomingCallModal.css +0 -192
- package/examples/demo/src/components/calling/IncomingCallModal.tsx +0 -78
- package/examples/demo/src/components/calling/MinimizedCall.css +0 -156
- package/examples/demo/src/components/calling/MinimizedCall.tsx +0 -78
- package/examples/demo/src/components/conference/ConferenceHeader.css +0 -265
- package/examples/demo/src/components/conference/ConferenceHeader.tsx +0 -78
- package/examples/demo/src/components/conference/EnhancedControlBar.css +0 -356
- package/examples/demo/src/components/conference/EnhancedControlBar.tsx +0 -262
- package/examples/demo/src/components/conference/PaginationControls.css +0 -67
- package/examples/demo/src/components/conference/PaginationControls.tsx +0 -64
- package/examples/demo/src/components/conference/ParticipantGrid.css +0 -153
- package/examples/demo/src/components/conference/ParticipantGrid.tsx +0 -87
- package/examples/demo/src/components/conference/ParticipantTile.css +0 -210
- package/examples/demo/src/components/conference/ParticipantTile.tsx +0 -114
- package/examples/demo/src/components/conference/VideoConference.css +0 -214
- package/examples/demo/src/components/conference/VideoConference.tsx +0 -93
- package/examples/demo/src/contexts/AuthContext.tsx +0 -105
- package/examples/demo/src/hooks/useAuth.ts +0 -5
- package/examples/demo/src/hooks/useCallTimer.ts +0 -42
- package/examples/demo/src/index.css +0 -68
- package/examples/demo/src/main.tsx +0 -10
- package/examples/demo/src/services/auth.service.ts +0 -153
- package/examples/demo/src/types/auth.types.ts +0 -31
- package/examples/demo/tsconfig.app.json +0 -28
- package/examples/demo/tsconfig.json +0 -7
- package/examples/demo/tsconfig.node.json +0 -26
- package/examples/demo/vite.config.ts +0 -15
- package/images/callpad-without-ai.png +0 -0
- package/packages/sdk/README.md +0 -97
- package/packages/sdk/documentation.md +0 -1132
- package/packages/sdk/openapi-ts.config.ts +0 -7
- package/packages/sdk/package.json +0 -88
- package/packages/sdk/src/core/auth.manager.ts +0 -52
- package/packages/sdk/src/core/events/event-bus.ts +0 -301
- package/packages/sdk/src/core/events/index.ts +0 -8
- package/packages/sdk/src/core/events/types.ts +0 -165
- package/packages/sdk/src/core/index.ts +0 -3
- package/packages/sdk/src/core/signal/api.config.ts +0 -49
- package/packages/sdk/src/core/signal/index.ts +0 -16
- package/packages/sdk/src/core/signal/signal.client.ts +0 -101
- package/packages/sdk/src/core/signal/types.ts +0 -110
- package/packages/sdk/src/core/socketio/handlers/base.handler.ts +0 -212
- package/packages/sdk/src/core/socketio/handlers/call-accepted.handler.ts +0 -34
- package/packages/sdk/src/core/socketio/handlers/call-canceled.handler.ts +0 -34
- package/packages/sdk/src/core/socketio/handlers/call-declined.handler.ts +0 -29
- package/packages/sdk/src/core/socketio/handlers/call-ended.handler.ts +0 -40
- package/packages/sdk/src/core/socketio/handlers/call-incoming.handler.ts +0 -72
- package/packages/sdk/src/core/socketio/handlers/call-join-info.handler.ts +0 -181
- package/packages/sdk/src/core/socketio/handlers/call-participant-joined.handler.ts +0 -42
- package/packages/sdk/src/core/socketio/handlers/call-participant-joining.handler.ts +0 -42
- package/packages/sdk/src/core/socketio/handlers/call-timeout.handler.ts +0 -31
- package/packages/sdk/src/core/socketio/handlers/handler.registry.ts +0 -62
- package/packages/sdk/src/core/socketio/handlers/index.ts +0 -21
- package/packages/sdk/src/core/socketio/handlers/participant-left.handler.ts +0 -37
- package/packages/sdk/src/core/socketio/handlers/schema.ts +0 -130
- package/packages/sdk/src/core/socketio/index.ts +0 -5
- package/packages/sdk/src/core/socketio/socket.manager.ts +0 -187
- package/packages/sdk/src/core/socketio/types.ts +0 -14
- package/packages/sdk/src/core/types.ts +0 -23
- package/packages/sdk/src/generated/api/core/ApiError.ts +0 -21
- package/packages/sdk/src/generated/api/core/ApiRequestOptions.ts +0 -13
- package/packages/sdk/src/generated/api/core/ApiResult.ts +0 -7
- package/packages/sdk/src/generated/api/core/CancelablePromise.ts +0 -126
- package/packages/sdk/src/generated/api/core/OpenAPI.ts +0 -55
- package/packages/sdk/src/generated/api/core/request.ts +0 -339
- package/packages/sdk/src/generated/api/index.ts +0 -5
- package/packages/sdk/src/generated/api/models.ts +0 -219
- package/packages/sdk/src/generated/api/services.ts +0 -225
- package/packages/sdk/src/hooks/index.ts +0 -21
- package/packages/sdk/src/hooks/useAutoJoin.ts +0 -66
- package/packages/sdk/src/hooks/useCallActions.ts +0 -28
- package/packages/sdk/src/hooks/useCallQuality.ts +0 -416
- package/packages/sdk/src/hooks/useCallState.ts +0 -23
- package/packages/sdk/src/hooks/useConnection.ts +0 -15
- package/packages/sdk/src/hooks/useDevices.ts +0 -296
- package/packages/sdk/src/hooks/useErrorRecovery.ts +0 -299
- package/packages/sdk/src/hooks/useErrors.ts +0 -84
- package/packages/sdk/src/hooks/useEvent.ts +0 -188
- package/packages/sdk/src/hooks/useMediaControls.ts +0 -215
- package/packages/sdk/src/hooks/useParticipantStatus.ts +0 -318
- package/packages/sdk/src/hooks/useParticipants.ts +0 -111
- package/packages/sdk/src/index.ts +0 -66
- package/packages/sdk/src/livekit/constants.ts +0 -76
- package/packages/sdk/src/livekit/device.manager.ts +0 -172
- package/packages/sdk/src/livekit/error-classifier.ts +0 -155
- package/packages/sdk/src/livekit/events/eventBridge.ts +0 -371
- package/packages/sdk/src/livekit/events/trackRegistry.ts +0 -114
- package/packages/sdk/src/livekit/index.ts +0 -49
- package/packages/sdk/src/livekit/livekit.service.ts +0 -110
- package/packages/sdk/src/livekit/media.controls.ts +0 -315
- package/packages/sdk/src/livekit/room.manager.ts +0 -79
- package/packages/sdk/src/livekit/track.utils.ts +0 -230
- package/packages/sdk/src/livekit/types.ts +0 -135
- package/packages/sdk/src/provider/RtcProvider.tsx +0 -78
- package/packages/sdk/src/services/call-actions.ts +0 -260
- package/packages/sdk/src/services/error-recovery.ts +0 -461
- package/packages/sdk/src/services/index.ts +0 -2
- package/packages/sdk/src/services/sdk-builder.ts +0 -104
- package/packages/sdk/src/state/errors.ts +0 -163
- package/packages/sdk/src/state/selectors.ts +0 -28
- package/packages/sdk/src/state/store.ts +0 -36
- package/packages/sdk/src/state/types.ts +0 -151
- package/packages/sdk/src/utils/logger.ts +0 -183
- package/packages/sdk/tsconfig.json +0 -49
- package/packages/sdk/tsup.config.ts +0 -51
- package/pnpm-workspace.yaml +0 -4
- package/tsconfig.base.json +0 -19
- package/turbo.json +0 -34
- /package/{packages/sdk/CHANGELOG.md → CHANGELOG.md} +0 -0
- /package/{packages/sdk/LICENSE → LICENSE} +0 -0
package/README.md
CHANGED
|
@@ -1,215 +1,97 @@
|
|
|
1
|
-
# CallPad
|
|
1
|
+
# CallPad SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Production-ready headless SDK for CallPad audio/video calls with React integration.
|
|
4
4
|
|
|
5
|
-
##
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
#
|
|
36
|
-
pnpm
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
46
|
+
## Features
|
|
59
47
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
##
|
|
58
|
+
## API Reference
|
|
72
59
|
|
|
73
|
-
|
|
60
|
+
### Providers
|
|
74
61
|
|
|
75
|
-
|
|
62
|
+
- `CallpadSdkProvider` - Main provider component for SDK configuration
|
|
76
63
|
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm login
|
|
80
|
-
# or set NPM_TOKEN in your .env file
|
|
81
|
-
```
|
|
64
|
+
### Hooks
|
|
82
65
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
###
|
|
75
|
+
### LiveKit Integration
|
|
89
76
|
|
|
90
|
-
|
|
77
|
+
```tsx
|
|
78
|
+
import { LiveKitProvider, useTrack } from 'vg-x07df/livekit';
|
|
91
79
|
|
|
92
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
##
|
|
91
|
+
## TypeScript Support
|
|
207
92
|
|
|
208
|
-
|
|
93
|
+
This package includes full TypeScript definitions. No additional @types packages needed.
|
|
209
94
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
+
```
|