connectbase-client 3.8.1 → 3.10.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/CHANGELOG.md CHANGED
@@ -3,6 +3,67 @@
3
3
  본 SDK 의 모든 주요 변경사항을 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/) 형식으로 기록합니다.
4
4
  버전은 [Semantic Versioning](https://semver.org/lang/ko/) 을 따릅니다.
5
5
 
6
+ ## [3.10.0] - 2026-05-10
7
+
8
+ ### Fixed — `/v1/auth/re-issue` 일시 실패에 강제 로그아웃 (platform-issue 019e11cf)
9
+
10
+ `HttpClient.refreshAccessToken()` 가 모든 실패에 즉시 토큰을 폐기해, 5xx / 네트워크 hiccup
11
+ 한 번에 활동 중인 사용자가 강제 로그아웃되던 문제를 수정. OAuth 클라이언트 표준
12
+ (Auth0 SPA SDK / MSAL / Amplify) 에 맞춰 실패를 분류한다.
13
+
14
+ | 응답 | 분류 | 토큰 처리 | 호출되는 콜백 |
15
+ |---|---|---|---|
16
+ | `5xx` / 네트워크 / abort / 손상된 200 | transient | **보존** (다음 호출에서 backoff 후 재시도) | `onTransientRefreshFailure`, `onAuthError` |
17
+ | `401` / `403` / `400 invalid_grant` / `400 invalid_token` | permanent | 폐기 | `onTokenExpired`, `onAuthError` |
18
+ | 그 외 4xx (예: `400 invalid_request`) | client_bug | **보존** (재시도 무의미, 패치 배포로 회복) | `onAuthError` |
19
+
20
+ ### Added — `onTransientRefreshFailure` 콜백
21
+
22
+ 일시적 refresh 실패 시 호출되는 새 콜백. 토큰은 살아있으므로 강제 로그아웃 없이
23
+ "연결이 잠시 불안정합니다" 같은 비파괴 알림을 띄울 때 사용:
24
+
25
+ ```typescript
26
+ const cb = new ConnectBase({
27
+ publicKey: '...',
28
+ onTransientRefreshFailure: () =>
29
+ toast.warn('연결이 잠시 불안정합니다. 잠시 후 자동 복구됩니다.'),
30
+ onTokenExpired: () => { window.location.href = '/login' },
31
+ })
32
+ ```
33
+
34
+ ### Behavior change (semver minor 로 분류한 이유)
35
+
36
+ `onTokenExpired` 의 호출 시점이 **refresh token 자체가 무효화된 경우로 한정**된다.
37
+ 이전 버전에서는 transient 실패에도 호출됐기에, 그 콜백을 "임의 refresh 실패 알림" 으로
38
+ 사용하던 앱은 동작 변화가 있다. transient 알림은 새 `onTransientRefreshFailure` 로 분리.
39
+ `onAuthError` 는 모든 실패에서 호출되는 점은 동일.
40
+
41
+ ## [3.9.0] - 2026-05-10
42
+
43
+ ### Added — Support API (end-user issue reporting)
44
+
45
+ 앱 사용자가 운영자에게 버그·질문·요청을 발행하는 채널을 SDK 메서드로 노출.
46
+
47
+ ```typescript
48
+ await cb.support.reportIssue({
49
+ title: "결제 화면이 멈춰요",
50
+ body: "결제 버튼 클릭 후 로딩이 끝나지 않습니다.",
51
+ category: "bug",
52
+ metadata: { pageUrl: window.location.href },
53
+ // 익명 발행
54
+ anonymousEmail: "user@example.com",
55
+ recaptchaToken: await grecaptcha.execute(SITE_KEY, { action: 'report_issue' }),
56
+ })
57
+ ```
58
+
59
+ - **AppMember JWT 자동 첨부**: 로그인 사용자는 `reporter_member_id` 자동 채워짐
60
+ - **익명 발행 지원**: AppMember 없어도 발행 가능 (운영자가 reCAPTCHA 활성화한 경우 토큰 권장)
61
+ - **응답 최소화**: `{ id, status: 'open', created_at }` 만 — 봇이 ID 구조 학습 회피
62
+ - **AI 자동 triage**: 백엔드(core-server)가 발행 직후 비동기로 요약·긴급도·카테고리·키워드·유사이슈 자동 분류
63
+ - **카테고리**: `bug` | `question` | `feature_request` | `incident` | `other`
64
+
65
+ 서버 측 가이드: [docs/cross-app-issue.md](https://github.com/connectbase-world/connectbase/blob/release/docs/cross-app-issue.md), 외부 ticketing 라우팅: [docs/cross-app-issue-webhook-guide.md](https://github.com/connectbase-world/connectbase/blob/release/docs/cross-app-issue-webhook-guide.md).
66
+
6
67
  ## [3.8.1] - 2026-05-07
7
68
 
8
69
  ### Fixed — `/v1/auth/re-issue` 가 콘솔/SDK cookie 공존 시 잘못된 토큰 발급
package/README.md CHANGED
@@ -80,6 +80,7 @@ const state = await gameClient.createRoom({
80
80
  - **Payments**: Subscription and one-time payment support
81
81
  - **AI Streaming**: Real-time AI text generation via WebSocket (Gemini)
82
82
  - **Endpoint**: Call your own GPU models on your own PC through one `cb_pk_*` key — ConnectBase forwards the payload as-is (dumb pipe)
83
+ - **Support**: End-user feedback/issue reporting — users send issues to app operators, AI auto-classifies summary/urgency/category
83
84
  - **CLI**: Command-line tool for deploying web storage and tunneling local services
84
85
 
85
86
  ## CLI
@@ -1073,6 +1074,33 @@ const status = await cb.subscription.getStatus()
1073
1074
  await cb.subscription.cancel()
1074
1075
  ```
1075
1076
 
1077
+ ### Support (End-user Issue Reporting)
1078
+
1079
+ End-user 가 앱 운영자에게 직접 버그·질문·요청을 발행하는 채널. 운영자 콘솔의 inbox 에 들어가며, AI 가 자동으로 요약·긴급도·카테고리를 분류한다 (운영자가 AI config 등록 시).
1080
+
1081
+ ```typescript
1082
+ // 로그인 사용자 (AppMember JWT 자동 첨부)
1083
+ await cb.support.reportIssue({
1084
+ title: "결제 화면이 멈춰요",
1085
+ body: "결제 버튼 클릭 후 로딩이 끝나지 않습니다.",
1086
+ category: "bug", // bug | question | feature_request | incident | other
1087
+ metadata: { pageUrl: window.location.href }
1088
+ })
1089
+
1090
+ // 익명 발행 + reCAPTCHA v3 (운영자가 RECAPTCHA_SECRET 설정한 경우 권장)
1091
+ const recaptchaToken = await grecaptcha.execute(SITE_KEY, { action: 'report_issue' })
1092
+ await cb.support.reportIssue({
1093
+ title: "...",
1094
+ body: "...",
1095
+ anonymousEmail: "user@example.com", // 회신 받을 이메일 (선택)
1096
+ recaptchaToken,
1097
+ })
1098
+ ```
1099
+
1100
+ 응답: `{ id, status: 'open', created_at }` (보안상 최소 정보만).
1101
+
1102
+ 발행자가 결과를 조회하는 채널은 후속 plan 에서 추가될 예정 — 현재는 운영자가 외부 webhook(이메일/Slack 등)으로 회신하는 방식 권장.
1103
+
1076
1104
  ## Types
1077
1105
 
1078
1106
  ### GameState
@@ -1130,7 +1158,7 @@ interface ConnectionState {
1130
1158
  import ConnectBase, { ApiError, AuthError } from 'connectbase-client'
1131
1159
 
1132
1160
  try {
1133
- await cb.auth.signInMember({ email, password })
1161
+ await cb.auth.signInMember({ login_id, password })
1134
1162
  } catch (error) {
1135
1163
  if (error instanceof ApiError) {
1136
1164
  // HTTP 응답 기반 에러: status/code/details 로 분기 가능