@gamecore-api/sdk 0.18.0 → 0.19.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/dist/client.d.ts CHANGED
@@ -117,6 +117,25 @@ export declare class GameCoreClient {
117
117
  initTelegram: () => Promise<TelegramInitResponse>;
118
118
  /** Poll Telegram auth status until authenticated or expired */
119
119
  pollTelegramStatus: (token: string, intervalMs?: number) => Promise<User>;
120
+ /**
121
+ * Read the storefront's Telegram OpenID Connect config. Returns
122
+ * { enabled: false, clientId: null } when the tenant hasn't set
123
+ * up Web Login in BotFather (the SPA should fall back to the
124
+ * deep-link flow). When enabled, hand `clientId` to telegram-
125
+ * login.js to render the native consent card.
126
+ */
127
+ getTelegramOidcConfig: () => Promise<{
128
+ enabled: boolean;
129
+ clientId: string | null;
130
+ }>;
131
+ /**
132
+ * Submit the RS256 id_token returned by telegram-login.js for
133
+ * server-side JWKS verification. On success the backend sets an
134
+ * auth cookie and returns the authenticated user, exactly like
135
+ * the Mini App / Widget verifiers. Optional `ref` threads a
136
+ * referral code through user creation on first login.
137
+ */
138
+ telegramOidc: (idToken: string, ref?: string) => Promise<TelegramAuthResponse>;
120
139
  /**
121
140
  * Verify Telegram Mini App initData and issue a session cookie.
122
141
  * Call this when your storefront is opened inside Telegram via the
package/dist/index.js CHANGED
@@ -108,6 +108,8 @@ class GameCoreClient {
108
108
  }
109
109
  }, intervalMs);
110
110
  }),
111
+ getTelegramOidcConfig: () => this.request("GET", "/auth/telegram/oidc/config"),
112
+ telegramOidc: (idToken, ref) => this.request("POST", "/auth/telegram/oidc/callback", { idToken, ref }, { rawResponse: true }),
111
113
  verifyMiniApp: (initData, ref) => this.request("POST", "/auth/telegram/miniapp", { initData, ref }, { rawResponse: true }),
112
114
  verifyTelegramWidget: (data, ref) => this.request("POST", "/auth/telegram/widget", { ...data, ref }, { rawResponse: true }),
113
115
  renderTelegramWidget: async (opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamecore-api/sdk",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "TypeScript SDK for GameCore API — browser-safe, zero dependencies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",