@playcademy/sdk 0.21.1-beta.2 → 0.21.1-beta.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/dist/index.d.ts CHANGED
@@ -1525,7 +1525,6 @@ declare abstract class PlaycademyBaseClient {
1525
1525
  * - Detects the runtime environment (iframe vs standalone)
1526
1526
  * - Configures the client with the appropriate context
1527
1527
  * - Sets up event listeners for token refresh
1528
- * - Exposes the client for debugging in development mode
1529
1528
  *
1530
1529
  * @param options - Optional configuration overrides
1531
1530
  * @param options.baseUrl - Override the base URL for API requests
@@ -2679,9 +2678,8 @@ declare class PlaycademyClient extends PlaycademyBaseClient {
2679
2678
  /**
2680
2679
  * Game runtime lifecycle and asset loading.
2681
2680
  * - `exit()` - Return to Cademy hub
2682
- * - `getGameToken()` - Get short-lived auth token
2683
2681
  * - `assets.url()`, `assets.json()`, `assets.fetch()` - Load game assets
2684
- * - `on('pause')`, `on('resume')` - Handle visibility changes
2682
+ * - `onPause(handler)`, `onResume(handler)` - Handle visibility changes
2685
2683
  */
2686
2684
  runtime: {
2687
2685
  exit: () => void;
@@ -2767,7 +2765,7 @@ declare class PlaycademyClient extends PlaycademyBaseClient {
2767
2765
  };
2768
2766
  };
2769
2767
  /**
2770
- * Game score submission and leaderboards.
2768
+ * Game score submission.
2771
2769
  * - `submit(score, metadata?)` - Record a game score
2772
2770
  */
2773
2771
  scores: {
package/dist/index.js CHANGED
@@ -3762,7 +3762,7 @@ async function request({
3762
3762
  return rawText && rawText.length > 0 ? rawText : undefined;
3763
3763
  }
3764
3764
  // src/version.ts
3765
- var SDK_VERSION = "0.21.1-beta.2";
3765
+ var SDK_VERSION = "0.21.1-beta.3";
3766
3766
 
3767
3767
  // src/clients/base.ts
3768
3768
  class PlaycademyBaseClient {
@@ -5273,7 +5273,6 @@ declare abstract class PlaycademyBaseClient {
5273
5273
  * - Detects the runtime environment (iframe vs standalone)
5274
5274
  * - Configures the client with the appropriate context
5275
5275
  * - Sets up event listeners for token refresh
5276
- * - Exposes the client for debugging in development mode
5277
5276
  *
5278
5277
  * @param options - Optional configuration overrides
5279
5278
  * @param options.baseUrl - Override the base URL for API requests
@@ -6797,7 +6796,6 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
6797
6796
  /**
6798
6797
  * Game runtime lifecycle and asset loading.
6799
6798
  * - `exit()` - Return to Cademy hub
6800
- * - `getGameToken()` - Get short-lived auth token
6801
6799
  * - `assets.url()`, `assets.json()`, `assets.fetch()` - Load game assets
6802
6800
  */
6803
6801
  runtime: {
@@ -6847,9 +6845,9 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
6847
6845
  };
6848
6846
  /**
6849
6847
  * Platform authentication (better-auth integration).
6850
- * - `login(email, password)` - Authenticate user
6848
+ * - `login({ email, password })` - Authenticate user
6851
6849
  * - `logout()` - End session
6852
- * - `getSession()` - Get current session
6850
+ * - `apiKeys.create()`, `apiKeys.list()`, `apiKeys.revoke(keyId)` - Manage API keys
6853
6851
  */
6854
6852
  auth: {
6855
6853
  login: (credentials: {
@@ -6878,7 +6876,7 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
6878
6876
  };
6879
6877
  /**
6880
6878
  * Administrative operations for platform management.
6881
- * - `games.pause()`, `games.unpause()` - Control game availability
6879
+ * - `games.pauseGame(gameId)`, `games.resumeGame(gameId)` - Control game availability
6882
6880
  */
6883
6881
  admin: {
6884
6882
  games: {
@@ -6887,10 +6885,11 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
6887
6885
  };
6888
6886
  };
6889
6887
  /**
6890
- * Developer operations for game publishing.
6891
- * - `publish(gameId)` - Deploy game to production
6892
- * - `uploads.getSignedUrl()` - Get upload URLs for assets
6893
- * - `apiKeys.create()`, `apiKeys.list()` - Manage API keys
6888
+ * Developer status and game management.
6889
+ * - `status.apply()`, `status.get()` - Request and check developer access
6890
+ * - `games.deploy(slug, options)` - Deploy a game
6891
+ * - `games.secrets`, `games.database`, `games.kv`, `games.bucket`,
6892
+ * `games.domains`, `games.logs` - Manage game resources
6894
6893
  */
6895
6894
  dev: {
6896
6895
  status: {
@@ -7001,11 +7000,10 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
7001
7000
  };
7002
7001
  };
7003
7002
  /**
7004
- * Game directory and session management.
7003
+ * Game directory and game tokens.
7005
7004
  * - `list()` - Get all games
7006
- * - `fetch(id)` - Get game by ID
7007
- * - `sessions.start()`, `sessions.end()` - Manage play sessions
7008
- * - `getGameToken(gameId)` - Get short-lived game auth token
7005
+ * - `fetch(idOrSlug)` - Get game by ID or slug
7006
+ * - `token.create(gameId, { apply })` - Mint a short-lived game auth token
7009
7007
  */
7010
7008
  games: {
7011
7009
  fetch: (gameIdOrSlug: string, options?: TTLCacheConfig) => Promise<FetchedGame>;
@@ -7033,9 +7031,9 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
7033
7031
  };
7034
7032
  };
7035
7033
  /**
7036
- * Cross-game leaderboards.
7037
- * - `get(leaderboardId)` - Fetch leaderboard rankings
7038
- * - `submit(leaderboardId, score)` - Submit score to leaderboard
7034
+ * Per-game leaderboards.
7035
+ * - `fetch(options)` - Fetch a game's leaderboard entries
7036
+ * - `getUserRank(gameId, userId)` - Get a user's rank in a game
7039
7037
  */
7040
7038
  leaderboard: {
7041
7039
  fetch: (options?: LeaderboardOptions) => Promise<GameLeaderboardEntry[]>;
@@ -7055,7 +7053,7 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
7055
7053
  /**
7056
7054
  * Score submission and user score queries.
7057
7055
  * - `submit(gameId, score, metadata?)` - Record a game score
7058
- * - `getByUser(userId)` - Get all scores for a user
7056
+ * - `getByUser(gameId, userId)` - Get a user's scores for a game
7059
7057
  */
7060
7058
  scores: {
7061
7059
  submit: (gameId: string, score: number, metadata?: Record<string, unknown>) => Promise<ScoreSubmission>;
package/dist/internal.js CHANGED
@@ -4672,7 +4672,7 @@ async function request({
4672
4672
  return rawText && rawText.length > 0 ? rawText : undefined;
4673
4673
  }
4674
4674
  // src/version.ts
4675
- var SDK_VERSION = "0.21.1-beta.2";
4675
+ var SDK_VERSION = "0.21.1-beta.3";
4676
4676
 
4677
4677
  // src/clients/base.ts
4678
4678
  class PlaycademyBaseClient {
@@ -370,7 +370,7 @@ function extractApiErrorInfo(error) {
370
370
  }
371
371
 
372
372
  // src/version.ts
373
- var SDK_VERSION = "0.21.1-beta.2";
373
+ var SDK_VERSION = "0.21.1-beta.3";
374
374
 
375
375
  // src/server/request.ts
376
376
  async function makeApiRequest(opts) {
package/dist/server.js CHANGED
@@ -559,7 +559,7 @@ function extractApiErrorInfo(error) {
559
559
  }
560
560
 
561
561
  // src/version.ts
562
- var SDK_VERSION = "0.21.1-beta.2";
562
+ var SDK_VERSION = "0.21.1-beta.3";
563
563
 
564
564
  // src/server/request.ts
565
565
  async function makeApiRequest(opts) {
package/dist/types.d.ts CHANGED
@@ -3104,7 +3104,6 @@ declare abstract class PlaycademyBaseClient {
3104
3104
  * - Detects the runtime environment (iframe vs standalone)
3105
3105
  * - Configures the client with the appropriate context
3106
3106
  * - Sets up event listeners for token refresh
3107
- * - Exposes the client for debugging in development mode
3108
3107
  *
3109
3108
  * @param options - Optional configuration overrides
3110
3109
  * @param options.baseUrl - Override the base URL for API requests
@@ -3660,9 +3659,8 @@ declare class PlaycademyClient extends PlaycademyBaseClient {
3660
3659
  /**
3661
3660
  * Game runtime lifecycle and asset loading.
3662
3661
  * - `exit()` - Return to Cademy hub
3663
- * - `getGameToken()` - Get short-lived auth token
3664
3662
  * - `assets.url()`, `assets.json()`, `assets.fetch()` - Load game assets
3665
- * - `on('pause')`, `on('resume')` - Handle visibility changes
3663
+ * - `onPause(handler)`, `onResume(handler)` - Handle visibility changes
3666
3664
  */
3667
3665
  runtime: {
3668
3666
  exit: () => void;
@@ -3748,7 +3746,7 @@ declare class PlaycademyClient extends PlaycademyBaseClient {
3748
3746
  };
3749
3747
  };
3750
3748
  /**
3751
- * Game score submission and leaderboards.
3749
+ * Game score submission.
3752
3750
  * - `submit(score, metadata?)` - Record a game score
3753
3751
  */
3754
3752
  scores: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcademy/sdk",
3
- "version": "0.21.1-beta.2",
3
+ "version": "0.21.1-beta.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {