@playcademy/sdk 0.1.17 → 0.2.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/README.md +49 -1
- package/dist/index.d.ts +404 -3377
- package/dist/index.js +736 -1769
- package/dist/internal.d.ts +6571 -0
- package/dist/internal.js +2972 -0
- package/dist/server.d.ts +86 -40
- package/dist/server.js +9 -35
- package/dist/types.d.ts +656 -1973
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -14,6 +14,54 @@ The SDK serves as the primary interface between your game and the Playcademy pla
|
|
|
14
14
|
- **Event System**: Real-time notifications for inventory changes, level ups, and more
|
|
15
15
|
- **Developer Tools**: Built-in support for game development and testing workflows
|
|
16
16
|
|
|
17
|
+
### Public vs Internal SDK
|
|
18
|
+
|
|
19
|
+
The Playcademy SDK is split into two entry points:
|
|
20
|
+
|
|
21
|
+
#### Public SDK (`@playcademy/sdk`)
|
|
22
|
+
|
|
23
|
+
For game developers building games on the Playcademy platform. Includes 8 essential namespaces:
|
|
24
|
+
|
|
25
|
+
- **Core**: `identity`, `runtime`, `backend`, `users`
|
|
26
|
+
- **Economy**: `credits`
|
|
27
|
+
- **Gameplay**: `scores`
|
|
28
|
+
- **Multiplayer**: `realtime`
|
|
29
|
+
- **Integrations**: `timeback`
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { PlaycademyClient } from '@playcademy/sdk'
|
|
33
|
+
|
|
34
|
+
const client = await PlaycademyClient.init()
|
|
35
|
+
await client.timeback.endActivity({
|
|
36
|
+
/* ... */
|
|
37
|
+
})
|
|
38
|
+
await client.users.inventory.add('gold-coin', 100)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### Internal SDK (`@playcademy/sdk/internal`)
|
|
42
|
+
|
|
43
|
+
For CLI, platform, and admin tools. Includes all 21 namespaces (8 public + 13 internal):
|
|
44
|
+
|
|
45
|
+
**Additional internal namespaces:**
|
|
46
|
+
|
|
47
|
+
- **Platform Auth**: `auth` (email/password login, API keys)
|
|
48
|
+
- **Administration**: `admin` (game management, items, currencies)
|
|
49
|
+
- **Developer Tools**: `dev` (publish games, uploads)
|
|
50
|
+
- **Game Directory**: `games` (fetch, list, sessions)
|
|
51
|
+
- **Overworld Features**: `character`, `achievements`, `leaderboard`, `levels`, `shop`, `maps`, `sprites`, `notifications`
|
|
52
|
+
- **Analytics**: `telemetry`
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { PlaycademyClient } from '@playcademy/sdk/internal'
|
|
56
|
+
|
|
57
|
+
const client = new PlaycademyClient({ baseUrl: 'https://hub.playcademy.net' })
|
|
58
|
+
await client.auth.login({ email: 'dev@example.com', password: '***' })
|
|
59
|
+
const games = await client.games.list()
|
|
60
|
+
await client.admin.games.pauseGame('game-123')
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Note**: The internal SDK is for trusted code only (CLI, platform internals). Game developers should use the public SDK.
|
|
64
|
+
|
|
17
65
|
### Key Benefits
|
|
18
66
|
|
|
19
67
|
- **Zero Configuration**: Automatic initialization with environment detection
|
|
@@ -40,7 +88,7 @@ The SDK automatically monitors network connectivity and provides hooks for games
|
|
|
40
88
|
- **Platform Integration**: Built-in helpers for displaying connection alerts
|
|
41
89
|
- **Zero Config**: Works out of the box, customizable when needed
|
|
42
90
|
|
|
43
|
-
See
|
|
91
|
+
See the SDK Browser documentation for detailed connection monitoring documentation and examples.
|
|
44
92
|
|
|
45
93
|
## Installation
|
|
46
94
|
|