@spatialwalk/avatarkit 1.0.0-beta.27 → 1.0.0-beta.28
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 +19 -4
- package/README.md +24 -24
- package/dist/{StreamingAudioPlayer-C6v9Ed55.js → StreamingAudioPlayer-DLwlYvg8.js} +1 -1
- package/dist/core/AvatarDownloader.d.ts +2 -2
- package/dist/core/{AvatarKit.d.ts → AvatarSDK.d.ts} +1 -1
- package/dist/{index-s9KqPWVW.js → index-ByaJBTpA.js} +863 -853
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.0-beta.28] - 2025-12-08
|
|
11
|
+
|
|
12
|
+
### 🔄 Breaking Changes
|
|
13
|
+
- **Class Renamed** - `AvatarKit` class has been renamed to `AvatarSDK` for better consistency
|
|
14
|
+
- Update all imports: `import { AvatarKit } from '@spatialwalk/avatarkit'` → `import { AvatarSDK } from '@spatialwalk/avatarkit'`
|
|
15
|
+
- Update all API calls: `AvatarKit.initialize()` → `AvatarSDK.initialize()`
|
|
16
|
+
- All static methods and properties remain the same, only the class name has changed
|
|
17
|
+
|
|
18
|
+
### 🔧 Improvements
|
|
19
|
+
- **Rendering Optimizations** - Added fragment shader discard optimization to improve performance and edge quality
|
|
20
|
+
- **Shader Alignment** - Removed view matrix transpose to align with Android SDK implementation
|
|
21
|
+
- **Resource Cleanup** - Removed unused `frameMono` and `audioMono` resources from SDK and tests
|
|
22
|
+
|
|
8
23
|
## [1.0.0-beta.27] - 2025-12-04
|
|
9
24
|
|
|
10
25
|
### 🐛 Bugfix
|
|
@@ -115,8 +130,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
115
130
|
- Fallback mode is interruptible, just like normal playback mode
|
|
116
131
|
|
|
117
132
|
### 🔧 API Changes
|
|
118
|
-
- **Playback Mode Configuration** - Moved playback mode configuration from `AvatarView` constructor to `
|
|
119
|
-
- Playback mode is now determined by `drivingServiceMode` in `
|
|
133
|
+
- **Playback Mode Configuration** - Moved playback mode configuration from `AvatarView` constructor to `AvatarSDK.initialize()`
|
|
134
|
+
- Playback mode is now determined by `drivingServiceMode` in `AvatarSDK.initialize()` configuration
|
|
120
135
|
- `AvatarView` constructor now only requires `avatar` and `container` parameters
|
|
121
136
|
- Removed `AvatarViewOptions` interface
|
|
122
137
|
- `container` parameter is now required (no longer optional)
|
|
@@ -222,7 +237,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
222
237
|
|
|
223
238
|
### 📚 Documentation
|
|
224
239
|
- Updated demo repository link in README.md
|
|
225
|
-
- Changed example project link from `Avatarkit-web-demo` to `
|
|
240
|
+
- Changed example project link from `Avatarkit-web-demo` to `AvatarSDK-Web-Demo` to match the new repository name
|
|
226
241
|
|
|
227
242
|
---
|
|
228
243
|
|
|
@@ -232,7 +247,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
232
247
|
- Cleaned up public API to hide internal implementation details
|
|
233
248
|
- Marked internal methods with `@internal` JSDoc tag to exclude them from TypeScript declarations
|
|
234
249
|
- Removed unused environment configuration options (`realtimeApiBaseUrl`, `realtimeWsUrl`)
|
|
235
|
-
- Added `appId` getter to `
|
|
250
|
+
- Added `appId` getter to `AvatarSDK` for accessing initialized app ID
|
|
236
251
|
- Internal methods like `getEnvironmentConfig`, `logEvent`, `getCanvas`, `getCameraConfig`, `updateCameraConfig` are now properly hidden from public API
|
|
237
252
|
|
|
238
253
|
### 🐛 Bug Fixes
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SPAvatarSDK SDK
|
|
2
2
|
|
|
3
3
|
Real-time virtual avatar rendering SDK based on 3D Gaussian Splatting, supporting audio-driven animation rendering and high-quality 3D rendering.
|
|
4
4
|
|
|
@@ -24,7 +24,7 @@ npm install @spatialwalk/avatarkit
|
|
|
24
24
|
|
|
25
25
|
```typescript
|
|
26
26
|
import {
|
|
27
|
-
|
|
27
|
+
AvatarSDK,
|
|
28
28
|
AvatarManager,
|
|
29
29
|
AvatarView,
|
|
30
30
|
Configuration,
|
|
@@ -47,10 +47,10 @@ const configuration: Configuration = {
|
|
|
47
47
|
// - LogLevel.all: All logs (info, warning, error)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
await
|
|
50
|
+
await AvatarSDK.initialize('your-app-id', configuration)
|
|
51
51
|
|
|
52
52
|
// Set sessionToken (if needed, call separately)
|
|
53
|
-
//
|
|
53
|
+
// AvatarSDK.setSessionToken('your-session-token')
|
|
54
54
|
|
|
55
55
|
// 2. Load character
|
|
56
56
|
const avatarManager = AvatarManager.shared
|
|
@@ -59,7 +59,7 @@ const avatar = await avatarManager.load('character-id', (progress) => {
|
|
|
59
59
|
})
|
|
60
60
|
|
|
61
61
|
// 3. Create view (automatically creates Canvas and AvatarController)
|
|
62
|
-
// The playback mode is determined by drivingServiceMode in
|
|
62
|
+
// The playback mode is determined by drivingServiceMode in AvatarSDK configuration
|
|
63
63
|
// - DrivingServiceMode.sdk: SDK mode - SDK handles WebSocket communication
|
|
64
64
|
// - DrivingServiceMode.host: Host mode - Host app provides audio and animation data
|
|
65
65
|
const container = document.getElementById('avatar-container')
|
|
@@ -94,7 +94,7 @@ avatarView.avatarController.yieldFramesData(animationData, conversationId)
|
|
|
94
94
|
|
|
95
95
|
Check the example code in the GitHub repository for complete usage flows for both modes.
|
|
96
96
|
|
|
97
|
-
**Example Project:** [
|
|
97
|
+
**Example Project:** [AvatarSDK-Web-Demo](https://github.com/spatialwalk/AvatarSDK-Web-Demo)
|
|
98
98
|
|
|
99
99
|
This repository contains complete examples for Vanilla JS, Vue 3, and React, demonstrating:
|
|
100
100
|
- SDK mode: Real-time audio input with automatic animation data reception
|
|
@@ -112,30 +112,30 @@ The SDK uses a three-layer architecture for clear separation of concerns:
|
|
|
112
112
|
|
|
113
113
|
### Core Components
|
|
114
114
|
|
|
115
|
-
- **
|
|
115
|
+
- **AvatarSDK** - SDK initialization and management
|
|
116
116
|
- **AvatarManager** - Character resource loading and management
|
|
117
117
|
- **AvatarView** - 3D rendering view (rendering layer)
|
|
118
118
|
- **AvatarController** - Audio/animation playback controller (playback layer)
|
|
119
119
|
|
|
120
120
|
### Playback Modes
|
|
121
121
|
|
|
122
|
-
The SDK supports two playback modes, configured in `
|
|
122
|
+
The SDK supports two playback modes, configured in `AvatarSDK.initialize()`:
|
|
123
123
|
|
|
124
124
|
#### 1. SDK Mode (Default)
|
|
125
|
-
- Configured via `drivingServiceMode: DrivingServiceMode.sdk` in `
|
|
125
|
+
- Configured via `drivingServiceMode: DrivingServiceMode.sdk` in `AvatarSDK.initialize()`
|
|
126
126
|
- SDK handles WebSocket communication automatically
|
|
127
127
|
- Send audio data via `AvatarController.send()`
|
|
128
128
|
- SDK receives animation data from backend and synchronizes playback
|
|
129
129
|
- Best for: Real-time audio input scenarios
|
|
130
130
|
|
|
131
131
|
#### 2. Host Mode
|
|
132
|
-
- Configured via `drivingServiceMode: DrivingServiceMode.host` in `
|
|
132
|
+
- Configured via `drivingServiceMode: DrivingServiceMode.host` in `AvatarSDK.initialize()`
|
|
133
133
|
- Host application manages its own network/data fetching
|
|
134
134
|
- Host application provides both audio and animation data
|
|
135
135
|
- SDK only handles synchronized playback
|
|
136
136
|
- Best for: Custom data sources, pre-recorded content, or custom network implementations
|
|
137
137
|
|
|
138
|
-
**Note:** The playback mode is determined by `drivingServiceMode` in `
|
|
138
|
+
**Note:** The playback mode is determined by `drivingServiceMode` in `AvatarSDK.initialize()` configuration.
|
|
139
139
|
|
|
140
140
|
### Fallback Mechanism
|
|
141
141
|
|
|
@@ -209,40 +209,40 @@ RenderSystem → WebGPU/WebGL → Canvas rendering
|
|
|
209
209
|
|
|
210
210
|
## 📚 API Reference
|
|
211
211
|
|
|
212
|
-
###
|
|
212
|
+
### AvatarSDK
|
|
213
213
|
|
|
214
214
|
The core management class of the SDK, responsible for initialization and global configuration.
|
|
215
215
|
|
|
216
216
|
```typescript
|
|
217
217
|
// Initialize SDK
|
|
218
|
-
await
|
|
218
|
+
await AvatarSDK.initialize(appId: string, configuration: Configuration)
|
|
219
219
|
|
|
220
220
|
// Check initialization status
|
|
221
|
-
const isInitialized =
|
|
221
|
+
const isInitialized = AvatarSDK.isInitialized
|
|
222
222
|
|
|
223
223
|
// Get initialized app ID
|
|
224
|
-
const appId =
|
|
224
|
+
const appId = AvatarSDK.appId
|
|
225
225
|
|
|
226
226
|
// Get configuration
|
|
227
|
-
const config =
|
|
227
|
+
const config = AvatarSDK.configuration
|
|
228
228
|
|
|
229
229
|
// Set sessionToken (if needed, call separately)
|
|
230
|
-
|
|
230
|
+
AvatarSDK.setSessionToken('your-session-token')
|
|
231
231
|
|
|
232
232
|
// Set userId (optional, for telemetry)
|
|
233
|
-
|
|
233
|
+
AvatarSDK.setUserId('user-id')
|
|
234
234
|
|
|
235
235
|
// Get sessionToken
|
|
236
|
-
const sessionToken =
|
|
236
|
+
const sessionToken = AvatarSDK.sessionToken
|
|
237
237
|
|
|
238
238
|
// Get userId
|
|
239
|
-
const userId =
|
|
239
|
+
const userId = AvatarSDK.userId
|
|
240
240
|
|
|
241
241
|
// Get SDK version
|
|
242
|
-
const version =
|
|
242
|
+
const version = AvatarSDK.version
|
|
243
243
|
|
|
244
244
|
// Cleanup resources (must be called when no longer in use)
|
|
245
|
-
|
|
245
|
+
AvatarSDK.cleanup()
|
|
246
246
|
```
|
|
247
247
|
|
|
248
248
|
### AvatarManager
|
|
@@ -280,7 +280,7 @@ constructor(avatar: Avatar, container: HTMLElement)
|
|
|
280
280
|
- SDK automatically handles resize events via ResizeObserver
|
|
281
281
|
|
|
282
282
|
**Playback Mode:**
|
|
283
|
-
- The playback mode is determined by `drivingServiceMode` in `
|
|
283
|
+
- The playback mode is determined by `drivingServiceMode` in `AvatarSDK.initialize()` configuration
|
|
284
284
|
- The playback mode is fixed when creating `AvatarView` and persists throughout its lifecycle
|
|
285
285
|
- Cannot be changed after creation
|
|
286
286
|
|
|
@@ -432,7 +432,7 @@ enum LogLevel {
|
|
|
432
432
|
- `LogLevel.error`: Only error logs
|
|
433
433
|
- `LogLevel.warning`: Warning and error logs
|
|
434
434
|
- `LogLevel.all` (default): All logs (info, warning, error)
|
|
435
|
-
- `sessionToken`: Set separately via `
|
|
435
|
+
- `sessionToken`: Set separately via `AvatarSDK.setSessionToken()`, not in Configuration
|
|
436
436
|
|
|
437
437
|
```typescript
|
|
438
438
|
enum Environment {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var C = Object.defineProperty;
|
|
2
2
|
var g = (h, t, e) => t in h ? C(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
|
|
3
3
|
var s = (h, t, e) => g(h, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { A as m, e as f, l as c, a as n } from "./index-
|
|
4
|
+
import { A as m, e as f, l as c, a as n } from "./index-ByaJBTpA.js";
|
|
5
5
|
class y {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
// AudioContext is managed internally
|
|
@@ -65,12 +65,12 @@ export declare class AvatarDownloader {
|
|
|
65
65
|
*/
|
|
66
66
|
clear(): void;
|
|
67
67
|
/**
|
|
68
|
-
* Get
|
|
68
|
+
* Get SPAvatarSDK SDK API Client (api.open.spatialwalk.top for cn, api.open.spatialwalk.cloud for intl)
|
|
69
69
|
* Used for: character details and resource URLs (public endpoints, no auth required)
|
|
70
70
|
*/
|
|
71
71
|
private getSdkApiClient;
|
|
72
72
|
/**
|
|
73
|
-
* Get single character by ID from
|
|
73
|
+
* Get single character by ID from SPAvatarSDK SDK API (v2, iOS compatible)
|
|
74
74
|
* Domain: api.open.spatialwalk.top (cn) / api.open.spatialwalk.cloud (intl)
|
|
75
75
|
* Auth: Public endpoint, no authentication required
|
|
76
76
|
* Returns CharacterMeta with nested resource structure
|