@rqmii_immersive/agent-react-sdk 1.0.0 → 1.0.2
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.frameworks.md +12 -12
- package/README.md +10 -18
- package/README.simple.md +5 -5
- package/dist/index.d.ts +5 -1
- package/dist/rqmii-react-agent-sdk.cjs +361 -361
- package/dist/rqmii-react-agent-sdk.cjs.map +1 -1
- package/dist/rqmii-react-agent-sdk.js +2361 -2347
- package/dist/rqmii-react-agent-sdk.js.map +1 -1
- package/package.json +1 -1
package/README.frameworks.md
CHANGED
|
@@ -15,8 +15,8 @@ npm install @rqmii_immersive/agent-react-sdk
|
|
|
15
15
|
`.env`:
|
|
16
16
|
|
|
17
17
|
```env
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
VITE_AGENT_API_URL=https://api.example.com
|
|
19
|
+
VITE_AGENT_WS_URL=wss://realtime.example.com
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
### App Example
|
|
@@ -35,8 +35,8 @@ function UI() {
|
|
|
35
35
|
export default function App() {
|
|
36
36
|
return (
|
|
37
37
|
<RqmiiAgentRoom
|
|
38
|
-
wsUrl={import.meta.env.
|
|
39
|
-
restUrl={import.meta.env.
|
|
38
|
+
wsUrl={import.meta.env.VITE_AGENT_WS_URL}
|
|
39
|
+
restUrl={import.meta.env.VITE_AGENT_API_URL}
|
|
40
40
|
session={{ mode: "initialize", apiKey: "YOUR_API_KEY", language: "en" }}
|
|
41
41
|
connect
|
|
42
42
|
>
|
|
@@ -61,8 +61,8 @@ npm install @rqmii_immersive/agent-react-sdk
|
|
|
61
61
|
`.env.local`:
|
|
62
62
|
|
|
63
63
|
```env
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
NEXT_PUBLIC_AGENT_API_URL=https://api.example.com
|
|
65
|
+
NEXT_PUBLIC_AGENT_WS_URL=wss://realtime.example.com
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### Client Component
|
|
@@ -94,8 +94,8 @@ function UI() {
|
|
|
94
94
|
export default function AgentPage() {
|
|
95
95
|
return (
|
|
96
96
|
<RqmiiAgentRoom
|
|
97
|
-
wsUrl={process.env.
|
|
98
|
-
restUrl={process.env.
|
|
97
|
+
wsUrl={process.env.NEXT_PUBLIC_AGENT_WS_URL}
|
|
98
|
+
restUrl={process.env.NEXT_PUBLIC_AGENT_API_URL}
|
|
99
99
|
session={{ mode: "initialize", apiKey: "YOUR_API_KEY", language: "en" }}
|
|
100
100
|
connect
|
|
101
101
|
>
|
|
@@ -124,8 +124,8 @@ npm install @rqmii_immersive/agent-react-sdk
|
|
|
124
124
|
`.env`:
|
|
125
125
|
|
|
126
126
|
```env
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
REACT_APP_AGENT_API_URL=https://api.example.com
|
|
128
|
+
REACT_APP_AGENT_WS_URL=wss://realtime.example.com
|
|
129
129
|
```
|
|
130
130
|
|
|
131
131
|
### App Example
|
|
@@ -144,8 +144,8 @@ function UI() {
|
|
|
144
144
|
export default function App() {
|
|
145
145
|
return (
|
|
146
146
|
<RqmiiAgentRoom
|
|
147
|
-
wsUrl={process.env.
|
|
148
|
-
restUrl={process.env.
|
|
147
|
+
wsUrl={process.env.REACT_APP_AGENT_WS_URL}
|
|
148
|
+
restUrl={process.env.REACT_APP_AGENT_API_URL}
|
|
149
149
|
session={{ mode: "initialize", apiKey: "YOUR_API_KEY", language: "en" }}
|
|
150
150
|
connect
|
|
151
151
|
>
|
package/README.md
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
# Rqmii React Agent SDK
|
|
2
2
|
|
|
3
|
-
Standalone React SDK for
|
|
4
|
-
|
|
5
|
-
- `RqmiiAgentBackendAPI` REST endpoints (`/sessions/init`, `/sessions/join`)
|
|
6
|
-
- `RqmiiAgentBackendJs` realtime Socket.IO server
|
|
7
|
-
|
|
8
|
-
Quick navigation:
|
|
9
|
-
|
|
10
|
-
- Full guide: `README.md` (this file)
|
|
11
|
-
- Simple guide: `README.simple.md`
|
|
12
|
-
- Framework recipes (Vite/Next.js/CRA): `README.frameworks.md`
|
|
3
|
+
Standalone React SDK for building realtime agent experiences in web apps.
|
|
13
4
|
|
|
14
5
|
This SDK gives you a LiveKit-style integration model:
|
|
15
6
|
|
|
@@ -29,18 +20,18 @@ If you are testing locally from this mono-repo:
|
|
|
29
20
|
npm install file:../RqmiiAgentReactSDK
|
|
30
21
|
```
|
|
31
22
|
|
|
32
|
-
## 2. Required
|
|
23
|
+
## 2. Required Configuration
|
|
33
24
|
|
|
34
25
|
You must provide both URLs to the SDK:
|
|
35
26
|
|
|
36
|
-
- `restUrl`:
|
|
37
|
-
- `wsUrl`: realtime
|
|
27
|
+
- `restUrl`: REST API base URL (for session init/join)
|
|
28
|
+
- `wsUrl`: realtime Socket.IO URL
|
|
38
29
|
|
|
39
30
|
Typical env values:
|
|
40
31
|
|
|
41
32
|
```env
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
VITE_AGENT_API_URL=https://api.example.com
|
|
34
|
+
VITE_AGENT_WS_URL=wss://realtime.example.com
|
|
44
35
|
```
|
|
45
36
|
|
|
46
37
|
## 3. Import Surface
|
|
@@ -109,8 +100,8 @@ function ChatUI() {
|
|
|
109
100
|
export default function App() {
|
|
110
101
|
return (
|
|
111
102
|
<RqmiiAgentRoom
|
|
112
|
-
wsUrl={import.meta.env.
|
|
113
|
-
restUrl={import.meta.env.
|
|
103
|
+
wsUrl={import.meta.env.VITE_AGENT_WS_URL}
|
|
104
|
+
restUrl={import.meta.env.VITE_AGENT_API_URL}
|
|
114
105
|
session={{ mode: "initialize", apiKey: "YOUR_API_KEY", language: "en" }}
|
|
115
106
|
connect
|
|
116
107
|
onError={(e) => console.error(e)}
|
|
@@ -427,4 +418,5 @@ Check:
|
|
|
427
418
|
|
|
428
419
|
## 14. Current Scope
|
|
429
420
|
|
|
430
|
-
This SDK
|
|
421
|
+
This SDK supports React, TypeScript (ships `.d.ts`), and Next.js client-side integration.
|
|
422
|
+
Use it inside client components (`"use client"`), since realtime sockets/media APIs are browser runtime features.
|
package/README.simple.md
CHANGED
|
@@ -12,14 +12,14 @@ npm install @rqmii_immersive/agent-react-sdk
|
|
|
12
12
|
|
|
13
13
|
You need:
|
|
14
14
|
|
|
15
|
-
- `restUrl` ->
|
|
15
|
+
- `restUrl` -> REST API URL
|
|
16
16
|
- `wsUrl` -> realtime Socket.IO URL
|
|
17
17
|
|
|
18
18
|
Example env:
|
|
19
19
|
|
|
20
20
|
```env
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
VITE_AGENT_API_URL=https://api.example.com
|
|
22
|
+
VITE_AGENT_WS_URL=wss://realtime.example.com
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Basic Usage
|
|
@@ -55,8 +55,8 @@ function ChatUI() {
|
|
|
55
55
|
export default function App() {
|
|
56
56
|
return (
|
|
57
57
|
<RqmiiAgentRoom
|
|
58
|
-
wsUrl={import.meta.env.
|
|
59
|
-
restUrl={import.meta.env.
|
|
58
|
+
wsUrl={import.meta.env.VITE_AGENT_WS_URL}
|
|
59
|
+
restUrl={import.meta.env.VITE_AGENT_API_URL}
|
|
60
60
|
session={{ mode: "initialize", apiKey: "YOUR_API_KEY", language: "en" }}
|
|
61
61
|
connect
|
|
62
62
|
>
|
package/dist/index.d.ts
CHANGED
|
@@ -135,6 +135,10 @@ export interface UseRqmiiConnectionReturn {
|
|
|
135
135
|
initializeSession: (args?: InitializeSessionArgs) => Promise<any>;
|
|
136
136
|
joinDesktopSession: (args: JoinDesktopSessionArgs) => Promise<any>;
|
|
137
137
|
disconnect: () => void;
|
|
138
|
+
interrupt: () => boolean;
|
|
139
|
+
refreshSessionActivity: () => boolean;
|
|
140
|
+
clearSessionHistory: () => boolean;
|
|
141
|
+
changeSessionLanguage: (language: string) => boolean;
|
|
138
142
|
}
|
|
139
143
|
|
|
140
144
|
export interface UseRqmiiMessagesReturn {
|
|
@@ -230,6 +234,7 @@ export interface RqmiiAgentContextValue extends UseRqmiiConnectionReturn {
|
|
|
230
234
|
interrupt: () => boolean;
|
|
231
235
|
refreshSessionActivity: () => boolean;
|
|
232
236
|
clearSessionHistory: () => boolean;
|
|
237
|
+
changeSessionLanguage: (language: string) => boolean;
|
|
233
238
|
clearMessages: () => void;
|
|
234
239
|
resumeAudioPlayback: () => Promise<void>;
|
|
235
240
|
attachAudioElement: (element: HTMLAudioElement | null) => void;
|
|
@@ -282,4 +287,3 @@ export function useRqmiiVAD(options?: UseRqmiiVADOptions): UseRqmiiVADReturn;
|
|
|
282
287
|
export function RqmiiAgentRoom(props: RqmiiAgentRoomProps): React.JSX.Element;
|
|
283
288
|
export function RqmiiCloudAvatarPlayer(props: RqmiiCloudAvatarPlayerProps): React.JSX.Element | null;
|
|
284
289
|
export const EpicPixelStreamingPlayer: React.ComponentType<EpicPixelStreamingPlayerProps>;
|
|
285
|
-
|