react-jssip-kit 0.1.0

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,4 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+ - Initial public release: React provider/hooks around bundled JsSIP client.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Victory Sip
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,75 @@
1
+ # react-jssip-kit
2
+
3
+ React provider and hooks that wrap [JsSIP](https://jssip.net/) so you can manage SIP/WebRTC calls with idiomatic React state.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install react-jssip-kit jssip
9
+ ```
10
+
11
+ Peer deps: `react@^18` and `react-dom@^18`.
12
+
13
+ ## Quick start
14
+
15
+ ```tsx
16
+ import React from "react";
17
+ import {
18
+ SipProvider,
19
+ useSipState,
20
+ useSipActions,
21
+ createSipClientInstance,
22
+ WebSocketInterface,
23
+ } from "react-jssip-kit";
24
+
25
+ const client = createSipClientInstance();
26
+
27
+ client.connect("sip:alice@example.com", "supersecret", {
28
+ sockets: [new WebSocketInterface("wss://example.com/ws")],
29
+ uri: "sip:example.com",
30
+ display_name: "Alice",
31
+ });
32
+
33
+ function CallControls() {
34
+ const { sessions, sipStatus } = useSipState();
35
+ const { call, hangup, mute, unmute } = useSipActions();
36
+ const active = sessions[0];
37
+
38
+ return (
39
+ <div>
40
+ <div>Status: {sipStatus}</div>
41
+ <button onClick={() => call("sip:bob@example.com")}>Call Bob</button>
42
+ <button onClick={() => hangup(active?.id)}>Hang up</button>
43
+ <button onClick={() => mute(active?.id)}>Mute</button>
44
+ <button onClick={() => unmute(active?.id)}>Unmute</button>
45
+ </div>
46
+ );
47
+ }
48
+
49
+ export function App() {
50
+ return (
51
+ <SipProvider client={client}>
52
+ <CallControls />
53
+ </SipProvider>
54
+ );
55
+ }
56
+ ```
57
+
58
+ ## API surface
59
+
60
+ - `SipProvider` — supplies `SipClient` and `SipEventManager` to children.
61
+ - Hooks: `useSip`, `useSipState`, `useSipActions`, `useSipEvent`, `useSipSessions`.
62
+ - Components: `CallPlayer` (basic audio/video elements).
63
+ - Utilities re-exported from bundled `jssip-lib`: `createSipClientInstance`, `createSipEventManager`, `WebSocketInterface`, status enums and types.
64
+
65
+ ## Build
66
+
67
+ ```bash
68
+ npm run build
69
+ ```
70
+
71
+ Outputs ESM + CJS + typings to `dist/`.
72
+
73
+ ## License
74
+
75
+ MIT