@reopt-ai/brandapp-sdk 4.0.0 → 4.1.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/ai/index.js +1 -1
  3. package/dist/ai-provider/index.js +1 -1
  4. package/dist/analytics/index.d.ts +22 -0
  5. package/dist/analytics/index.js +44 -0
  6. package/dist/auth/index.js +1 -1
  7. package/dist/better-auth/index.js +2 -2
  8. package/dist/client-2IaU8yUs.js +20 -0
  9. package/dist/{client-CAjqKz8i.js → client-CHp-oNJB.js} +3 -3
  10. package/dist/{client-D9MGqXbn.js → client-CP9RSAzn.js} +2 -2
  11. package/dist/{client-B0uRUF3T.js → client-CTefnLKY.js} +3 -3
  12. package/dist/{client-Djlg4STl.js → client-DE3FvPFs.js} +2 -2
  13. package/dist/client-DZu4msTG.d.ts +24 -0
  14. package/dist/{client-2qKKpHVy.js → client-D_7G37OB.js} +2 -2
  15. package/dist/{client-DUvf9x_b.js → client-Dnp7_J0-.js} +2 -2
  16. package/dist/{client-D72MLGRY.js → client-Dx3sYx7V.js} +4 -4
  17. package/dist/{client-DTWpLo8X.js → client-SwByFT8p.js} +2 -2
  18. package/dist/{client-C6USfykM.js → client-mvcEj1Vq.js} +3 -3
  19. package/dist/cms/index.js +1 -1
  20. package/dist/{config-D31PK7eu.js → config-tEsB7QhQ.js} +2 -2
  21. package/dist/eav/index.js +2 -2
  22. package/dist/feedback/index.js +1 -1
  23. package/dist/files/index.js +1 -1
  24. package/dist/{http-client-D1vuc20o.js → http-client-CCFmwnaQ.js} +2 -2
  25. package/dist/{index-CvNJ8zp1.d.ts → index-DJMr3ixA.d.ts} +3 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +13 -11
  28. package/dist/logout/index.js +1 -1
  29. package/dist/plans/index.js +1 -1
  30. package/dist/push/index.js +1 -1
  31. package/dist/{query-DyiwJX92.js → query-Bsgb85OE.js} +2 -2
  32. package/dist/react/hooks.d.ts +1 -1
  33. package/dist/terms/index.js +1 -1
  34. package/dist/testing/index.d.ts +1 -1
  35. package/package.json +11 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ This project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.1.0] — 2026-08-24
11
+
12
+ ### Added
13
+
14
+ - `sdk.analytics.getConfig()` + `@reopt-ai/brandapp-sdk/analytics` 서브패스
15
+ `startBrandappAnalytics(sdk)` — 브랜드의 reopt-data 수집 설정(`baseUrl`·`writeKey`)을
16
+ 브랜드앱 자격으로 받아 `@reopt-ai/data-sdk`를 한 번에 초기화한다(RFC-0023).
17
+ `@reopt-ai/data-sdk`는 optional peer — 이 서브패스를 쓰는 소비자만 설치한다.
18
+
10
19
  ## [4.0.0] — 2026-08-21
11
20
 
12
21
  Better Auth **1.7** 이행. 1.7이 generic OAuth를 소셜 제공자 경로로 재작성하고
package/dist/ai/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as createReoptAiClient, t as ReoptAiClient } from "../client-D72MLGRY.js";
1
+ import { n as createReoptAiClient, t as ReoptAiClient } from "../client-Dx3sYx7V.js";
2
2
 
3
3
  export { ReoptAiClient, createReoptAiClient };
@@ -1,4 +1,4 @@
1
- import { A as mapHttpStatusToError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-D31PK7eu.js";
1
+ import { A as mapHttpStatusToError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-tEsB7QhQ.js";
2
2
  import { t as createManagedAbort } from "../abort--nOBFN4M.js";
3
3
  import { t as createAuthHeader } from "../encoding-Bwfm3iaE.js";
4
4
  import { t as createSSELineProcessor } from "../sse-parser-FMjxM7sY.js";
@@ -0,0 +1,22 @@
1
+ import { n as createReoptAnalyticsClient, r as AnalyticsConfig, t as ReoptAnalyticsClient } from "../client-DZu4msTG.js";
2
+ import { identify, pageView, setConsent, track } from "@reopt-ai/data-sdk";
3
+ //#region src/analytics/browser.d.ts
4
+ type BrandappAnalytics = {
5
+ track: typeof track;
6
+ identify: typeof identify;
7
+ pageView: typeof pageView;
8
+ setConsent: typeof setConsent;
9
+ };
10
+ /**
11
+ * Fetches the config and initialises the SDK. Returns `null` when analytics is
12
+ * not enabled for the brand (project not provisioned) — callers can `?.` every
13
+ * call and ship the same code either way.
14
+ */
15
+ declare function startBrandappAnalytics(sdk: {
16
+ analytics: ReoptAnalyticsClient;
17
+ }, options?: {
18
+ accessToken?: string;
19
+ }): Promise<BrandappAnalytics | null>;
20
+ //#endregion
21
+ export { type AnalyticsConfig, type BrandappAnalytics, ReoptAnalyticsClient, createReoptAnalyticsClient, startBrandappAnalytics };
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,44 @@
1
+ import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-2IaU8yUs.js";
2
+ import { getInstance, identify, init, pageView, setConsent, track } from "@reopt-ai/data-sdk";
3
+
4
+ //#region src/analytics/browser.ts
5
+ /**
6
+ * Browser helper — wires `@reopt-ai/data-sdk` with the brand's collection config
7
+ * in one call, so a brandapp page needs no separate analytics credential.
8
+ *
9
+ * `@reopt-ai/data-sdk` is an optional peer dependency: import this module only
10
+ * from code that installs it.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { startBrandappAnalytics } from "@reopt-ai/brandapp-sdk/analytics";
15
+ *
16
+ * const analytics = await startBrandappAnalytics(sdk);
17
+ * analytics?.pageView();
18
+ * analytics?.track("signup_clicked", { plan: "pro" });
19
+ * analytics?.identify(customerId); // profileId = studio Customer.id
20
+ * ```
21
+ */
22
+ /**
23
+ * Fetches the config and initialises the SDK. Returns `null` when analytics is
24
+ * not enabled for the brand (project not provisioned) — callers can `?.` every
25
+ * call and ship the same code either way.
26
+ */
27
+ async function startBrandappAnalytics(sdk, options = {}) {
28
+ const config = await sdk.analytics.getConfig(options.accessToken);
29
+ if (!config.enabled) return null;
30
+ if (!getInstance()) init({
31
+ baseUrl: config.baseUrl,
32
+ writeKey: config.writeKey
33
+ });
34
+ return {
35
+ track,
36
+ identify,
37
+ pageView,
38
+ setConsent
39
+ };
40
+ }
41
+
42
+ //#endregion
43
+ export { ReoptAnalyticsClient, createReoptAnalyticsClient, startBrandappAnalytics };
44
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-D9MGqXbn.js";
1
+ import { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-CP9RSAzn.js";
2
2
 
3
3
  //#region src/auth/session.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { C as ServerError, D as isReoptSDKError, a as resolveIdBaseUrl, b as RateLimitError, s as AuthError, t as REOPT_BASE_URLS, x as ReoptSDKError } from "../config-D31PK7eu.js";
2
- import { t as BaseHttpClient } from "../http-client-D1vuc20o.js";
1
+ import { C as ServerError, D as isReoptSDKError, a as resolveIdBaseUrl, b as RateLimitError, s as AuthError, t as REOPT_BASE_URLS, x as ReoptSDKError } from "../config-tEsB7QhQ.js";
2
+ import { t as BaseHttpClient } from "../http-client-CCFmwnaQ.js";
3
3
  import { n as REOPT_PROVIDER_ID, t as REOPT_DEFAULT_SCOPES } from "../types-DjDRszNj.js";
4
4
  import { createAdapterFactory } from "better-auth/adapters";
5
5
  import { genericOAuth } from "better-auth/plugins";
@@ -0,0 +1,20 @@
1
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
+
3
+ //#region src/analytics/client.ts
4
+ var ReoptAnalyticsClient = class {
5
+ http;
6
+ constructor(config) {
7
+ this.http = new BaseHttpClient(config, `/api/v1/brandapp/${config.brandappId}/analytics`);
8
+ }
9
+ /** Basic or Bearer. `{ enabled: false }` until the brand's project is provisioned. */
10
+ async getConfig(accessToken) {
11
+ return (await this.http.fetch("GET", "/config", void 0, accessToken ? { bearerToken: accessToken } : void 0)).data;
12
+ }
13
+ };
14
+ function createReoptAnalyticsClient(config) {
15
+ return new ReoptAnalyticsClient(config);
16
+ }
17
+
18
+ //#endregion
19
+ export { createReoptAnalyticsClient as n, ReoptAnalyticsClient as t };
20
+ //# sourceMappingURL=client-2IaU8yUs.js.map
@@ -1,5 +1,5 @@
1
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
2
- import { t as buildQuery } from "./query-DyiwJX92.js";
1
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
+ import { t as buildQuery } from "./query-Bsgb85OE.js";
3
3
 
4
4
  //#region src/eav/cache.ts
5
5
  var SchemaCache = class {
@@ -500,4 +500,4 @@ function createReoptEavClient(config) {
500
500
 
501
501
  //#endregion
502
502
  export { createReoptEavClient as t };
503
- //# sourceMappingURL=client-CAjqKz8i.js.map
503
+ //# sourceMappingURL=client-CHp-oNJB.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
1
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
2
 
3
3
  //#region src/auth/client.ts
4
4
  function unwrap(body) {
@@ -50,4 +50,4 @@ function createReoptAuthClient(config) {
50
50
 
51
51
  //#endregion
52
52
  export { createReoptAuthClient as n, ReoptAuthClient as t };
53
- //# sourceMappingURL=client-D9MGqXbn.js.map
53
+ //# sourceMappingURL=client-CP9RSAzn.js.map
@@ -1,5 +1,5 @@
1
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
2
- import { t as buildQuery } from "./query-DyiwJX92.js";
1
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
+ import { t as buildQuery } from "./query-Bsgb85OE.js";
3
3
 
4
4
  //#region src/cms/client.ts
5
5
  function createReoptCmsClient(config) {
@@ -52,4 +52,4 @@ async list(query) {
52
52
 
53
53
  //#endregion
54
54
  export { createReoptCmsClient as t };
55
- //# sourceMappingURL=client-B0uRUF3T.js.map
55
+ //# sourceMappingURL=client-CTefnLKY.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
1
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
2
 
3
3
  //#region src/plans/client.ts
4
4
  function unwrap(body) {
@@ -78,4 +78,4 @@ function createReoptPlansClient(config) {
78
78
 
79
79
  //#endregion
80
80
  export { createReoptPlansClient as n, ReoptPlansClient as t };
81
- //# sourceMappingURL=client-Djlg4STl.js.map
81
+ //# sourceMappingURL=client-DE3FvPFs.js.map
@@ -0,0 +1,24 @@
1
+ import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
2
+ //#region src/analytics/types.d.ts
3
+ /** `GET /brandapp/{id}/analytics/config` — 브랜드의 reopt-data 브라우저 수집 설정. */
4
+ type AnalyticsConfig = {
5
+ enabled: false;
6
+ } | {
7
+ enabled: true;
8
+ /** reopt-data base URL — data-sdk `init({ baseUrl })`에 그대로. */
9
+ baseUrl: string;
10
+ /** 브라우저 수집 키(scopes ingest). 공개 값 — 읽기 권한이 없다. */
11
+ writeKey: string;
12
+ };
13
+ //#endregion
14
+ //#region src/analytics/client.d.ts
15
+ declare class ReoptAnalyticsClient {
16
+ private readonly http;
17
+ constructor(config: ReoptSDKConfig);
18
+ /** Basic or Bearer. `{ enabled: false }` until the brand's project is provisioned. */
19
+ getConfig(accessToken?: string): Promise<AnalyticsConfig>;
20
+ }
21
+ declare function createReoptAnalyticsClient(config: ReoptSDKConfig): ReoptAnalyticsClient;
22
+ //#endregion
23
+ export { createReoptAnalyticsClient as n, AnalyticsConfig as r, ReoptAnalyticsClient as t };
24
+ //# sourceMappingURL=client-DZu4msTG.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
1
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
2
 
3
3
  //#region src/push/client.ts
4
4
  var ReoptPushClient = class {
@@ -25,4 +25,4 @@ function createReoptPushClient(config) {
25
25
 
26
26
  //#endregion
27
27
  export { createReoptPushClient as n, ReoptPushClient as t };
28
- //# sourceMappingURL=client-2qKKpHVy.js.map
28
+ //# sourceMappingURL=client-D_7G37OB.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
1
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
2
 
3
3
  //#region src/terms/client.ts
4
4
  function unwrap(body) {
@@ -80,4 +80,4 @@ function createReoptTermsClient(config) {
80
80
 
81
81
  //#endregion
82
82
  export { createReoptTermsClient as n, ReoptTermsClient as t };
83
- //# sourceMappingURL=client-DUvf9x_b.js.map
83
+ //# sourceMappingURL=client-Dnp7_J0-.js.map
@@ -1,6 +1,6 @@
1
- import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-D31PK7eu.js";
1
+ import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-tEsB7QhQ.js";
2
2
  import { t as createManagedAbort } from "./abort--nOBFN4M.js";
3
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
3
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
4
4
  import { n as parseSSEStream } from "./sse-parser-FMjxM7sY.js";
5
5
 
6
6
  //#region src/ai/client.ts
@@ -224,7 +224,7 @@ var ReoptAiClient = class {
224
224
  }
225
225
  async fetchSSE(options) {
226
226
  const url = `${this.http.requestBaseUrl}/chat/completions`;
227
- const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.0.0"}-${url.length}`;
227
+ const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.1.0"}-${url.length}`;
228
228
  const ctx = {
229
229
  method: "POST",
230
230
  url,
@@ -302,4 +302,4 @@ function createReoptAiClient(config) {
302
302
 
303
303
  //#endregion
304
304
  export { createReoptAiClient as n, ReoptAiClient as t };
305
- //# sourceMappingURL=client-D72MLGRY.js.map
305
+ //# sourceMappingURL=client-Dx3sYx7V.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
1
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
2
 
3
3
  //#region src/feedback/client.ts
4
4
  function buildListQuery(query) {
@@ -83,4 +83,4 @@ function createReoptFeedbackClient(config) {
83
83
 
84
84
  //#endregion
85
85
  export { createReoptFeedbackClient as n, ReoptFeedbackClient as t };
86
- //# sourceMappingURL=client-DTWpLo8X.js.map
86
+ //# sourceMappingURL=client-SwByFT8p.js.map
@@ -1,6 +1,6 @@
1
- import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-D31PK7eu.js";
1
+ import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-tEsB7QhQ.js";
2
2
  import { t as createManagedAbort } from "./abort--nOBFN4M.js";
3
- import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-D1vuc20o.js";
3
+ import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
4
4
 
5
5
  //#region src/files/client.ts
6
6
  var ReoptFileClient = class {
@@ -270,4 +270,4 @@ function createReoptFileClient(config) {
270
270
 
271
271
  //#endregion
272
272
  export { createReoptFileClient as n, ReoptFileClient as t };
273
- //# sourceMappingURL=client-C6USfykM.js.map
273
+ //# sourceMappingURL=client-mvcEj1Vq.js.map
package/dist/cms/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createReoptCmsClient } from "../client-B0uRUF3T.js";
1
+ import { t as createReoptCmsClient } from "../client-CTefnLKY.js";
2
2
 
3
3
  //#region src/cms/helpers.ts
4
4
  function joinUrl(siteUrl, path) {
@@ -305,7 +305,7 @@ function mapHttpStatusToError(status, code, message, ctx, fieldErrors) {
305
305
 
306
306
  //#endregion
307
307
  //#region src/core/config.ts
308
- const SDK_VERSION = "4.0.0";
308
+ const SDK_VERSION = "4.1.0";
309
309
  /**
310
310
  * Default API host for EAV / AI / Files / CMS / Terms. Consumers can override
311
311
  * via `config.baseUrl` or the `REOPT_BASE_URL` env var.
@@ -484,4 +484,4 @@ function deriveIdFromBaseUrl(baseUrl) {
484
484
 
485
485
  //#endregion
486
486
  export { mapHttpStatusToError as A, ServerError as C, isReoptSDKError as D, isModelAccessError as E, isRequiredTermsError as O, RequiredTermsError as S, isCreditLimitError as T, ModelAccessError as _, resolveIdBaseUrl as a, RateLimitError as b, AuthUserNotFoundError as c, ConflictError as d, ContentFilterError as f, LimitExceededError as g, ForbiddenError as h, resolveBaseUrl as i, isValidationError as k, AuthUserRecordExistsError as l, DuplicateAuthUserError as m, SDK_VERSION as n, validateConfig as o, CreditLimitError as p, assertBrowserSafe as r, AuthError as s, REOPT_BASE_URLS as t, BadRequestError as u, ModelNotFoundError as v, ValidationError as w, ReoptSDKError as x, NotFoundError as y };
487
- //# sourceMappingURL=config-D31PK7eu.js.map
487
+ //# sourceMappingURL=config-tEsB7QhQ.js.map
package/dist/eav/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-D31PK7eu.js";
2
- import { t as createReoptEavClient } from "../client-CAjqKz8i.js";
1
+ import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-tEsB7QhQ.js";
2
+ import { t as createReoptEavClient } from "../client-CHp-oNJB.js";
3
3
 
4
4
  //#region src/eav/verify.ts
5
5
  async function verifyEavSchema(input) {
@@ -1,3 +1,3 @@
1
- import { n as createReoptFeedbackClient, t as ReoptFeedbackClient } from "../client-DTWpLo8X.js";
1
+ import { n as createReoptFeedbackClient, t as ReoptFeedbackClient } from "../client-SwByFT8p.js";
2
2
 
3
3
  export { ReoptFeedbackClient, createReoptFeedbackClient };
@@ -1,4 +1,4 @@
1
- import { n as createReoptFileClient, t as ReoptFileClient } from "../client-C6USfykM.js";
1
+ import { n as createReoptFileClient, t as ReoptFileClient } from "../client-mvcEj1Vq.js";
2
2
 
3
3
  //#region src/files/helpers.ts
4
4
  const REOPT_IMAGE_REMOTE_PATTERNS = [{
@@ -1,4 +1,4 @@
1
- import { A as mapHttpStatusToError, C as ServerError, a as resolveIdBaseUrl, b as RateLimitError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-D31PK7eu.js";
1
+ import { A as mapHttpStatusToError, C as ServerError, a as resolveIdBaseUrl, b as RateLimitError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-tEsB7QhQ.js";
2
2
  import { t as createAuthHeader } from "./encoding-Bwfm3iaE.js";
3
3
 
4
4
  //#region src/core/debug.ts
@@ -383,4 +383,4 @@ function parseFieldErrors(body) {
383
383
 
384
384
  //#endregion
385
385
  export { parseFieldErrors as n, BaseHttpClient as t };
386
- //# sourceMappingURL=http-client-D1vuc20o.js.map
386
+ //# sourceMappingURL=http-client-CCFmwnaQ.js.map
@@ -1,5 +1,6 @@
1
1
  import { l as SchemaDef, n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
2
2
  import { t as ReoptAiClient } from "./client-DPbXH8tr.js";
3
+ import { t as ReoptAnalyticsClient } from "./client-DZu4msTG.js";
3
4
  import { t as ReoptAuthClient } from "./client-yBQen4Yi.js";
4
5
  import { t as ReoptCmsClient } from "./client-BTS6Ewv_.js";
5
6
  import { t as ReoptEavClient } from "./client-CAGo56KO.js";
@@ -154,6 +155,7 @@ type ReoptSDK<S extends SchemaDef = SchemaDef> = {
154
155
  debug: NonNullable<ReoptSDKConfig["debug"]>;
155
156
  };
156
157
  ai: ReoptAiClient;
158
+ analytics: ReoptAnalyticsClient;
157
159
  auth: ReoptAuthClient;
158
160
  cms: ReoptCmsClient;
159
161
  eav: ReoptEavClient<S>;
@@ -166,4 +168,4 @@ type ReoptSDK<S extends SchemaDef = SchemaDef> = {
166
168
  declare function createReoptSDK<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptSDK<S>;
167
169
  //#endregion
168
170
  export { initReoptSDK as a, getReoptSDK as i, createReoptSDK as n, resetSDK as o, createLazySDK as r, BaseHttpClient as s, ReoptSDK as t };
169
- //# sourceMappingURL=index-CvNJ8zp1.d.ts.map
171
+ //# sourceMappingURL=index-DJMr3ixA.d.ts.map
package/dist/index.d.ts CHANGED
@@ -2,5 +2,5 @@ import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBas
2
2
  import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "./client-DPbXH8tr.js";
3
3
  import { C as isModelAccessError, D as mapHttpStatusToError, E as isValidationError, S as isCreditLimitError, T as isRequiredTermsError, _ as ReoptSDKError, a as ConflictError, b as ServerError, c as DuplicateAuthUserError, d as ForbiddenError, f as LimitExceededError, g as RateLimitError, h as NotFoundError, i as BadRequestError, l as ErrorDiagnostic, m as ModelNotFoundError, n as AuthUserNotFoundError, o as ContentFilterError, p as ModelAccessError, r as AuthUserRecordExistsError, s as CreditLimitError, t as AuthError, u as FieldError, v as ReoptSDKErrorContext, w as isReoptSDKError, x as ValidationError, y as RequiredTermsError } from "./errors-CRCcErNC.js";
4
4
  import { i as TypedEavRecord, r as EntityClient } from "./client-CAGo56KO.js";
5
- import { a as initReoptSDK, i as getReoptSDK, n as createReoptSDK, o as resetSDK, r as createLazySDK, s as BaseHttpClient, t as ReoptSDK } from "./index-CvNJ8zp1.js";
5
+ import { a as initReoptSDK, i as getReoptSDK, n as createReoptSDK, o as resetSDK, r as createLazySDK, s as BaseHttpClient, t as ReoptSDK } from "./index-DJMr3ixA.js";
6
6
  export { type AgentInfo, AuthError, AuthUserNotFoundError, AuthUserRecordExistsError, BadRequestError, BaseHttpClient, type ChatMessage, type CompletionOptions, type CompletionResult, ConflictError, ContentFilterError, type CreditInfo, CreditLimitError, type DebugLevel, type DebugLogger, DuplicateAuthUserError, type EntityClient, type ErrorDiagnostic, type FieldError, type FinishReason, ForbiddenError, type ImageGenerateOptions, type ImageGenerateResult, LimitExceededError, type MessageRole, ModelAccessError, type ModelInfo, ModelNotFoundError, NotFoundError, REOPT_BASE_URLS, RateLimitError, ReoptSDK, type ReoptSDKConfig, ReoptSDKError, type ReoptSDKErrorContext, RequiredTermsError, ServerError, type StreamDoneData, type StreamEvent, type TypedEavRecord, ValidationError, createLazySDK, createReoptSDK, getReoptSDK, initReoptSDK, isCreditLimitError, isModelAccessError, isReoptSDKError, isRequiredTermsError, isValidationError, mapHttpStatusToError, resetSDK, resolveBaseUrl };
package/dist/index.js CHANGED
@@ -1,14 +1,15 @@
1
- import { A as mapHttpStatusToError, C as ServerError, D as isReoptSDKError, E as isModelAccessError, O as isRequiredTermsError, S as RequiredTermsError, T as isCreditLimitError, _ as ModelAccessError, b as RateLimitError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, k as isValidationError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError, p as CreditLimitError, r as assertBrowserSafe, s as AuthError, t as REOPT_BASE_URLS, u as BadRequestError, v as ModelNotFoundError, w as ValidationError, x as ReoptSDKError, y as NotFoundError } from "./config-D31PK7eu.js";
2
- import { t as BaseHttpClient } from "./http-client-D1vuc20o.js";
3
- import { n as createReoptAiClient } from "./client-D72MLGRY.js";
4
- import { n as createReoptAuthClient } from "./client-D9MGqXbn.js";
5
- import { t as createReoptCmsClient } from "./client-B0uRUF3T.js";
6
- import { t as createReoptEavClient } from "./client-CAjqKz8i.js";
7
- import { n as createReoptFeedbackClient } from "./client-DTWpLo8X.js";
8
- import { n as createReoptFileClient } from "./client-C6USfykM.js";
9
- import { n as createReoptPlansClient } from "./client-Djlg4STl.js";
10
- import { n as createReoptPushClient } from "./client-2qKKpHVy.js";
11
- import { n as createReoptTermsClient } from "./client-DUvf9x_b.js";
1
+ import { A as mapHttpStatusToError, C as ServerError, D as isReoptSDKError, E as isModelAccessError, O as isRequiredTermsError, S as RequiredTermsError, T as isCreditLimitError, _ as ModelAccessError, b as RateLimitError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, k as isValidationError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError, p as CreditLimitError, r as assertBrowserSafe, s as AuthError, t as REOPT_BASE_URLS, u as BadRequestError, v as ModelNotFoundError, w as ValidationError, x as ReoptSDKError, y as NotFoundError } from "./config-tEsB7QhQ.js";
2
+ import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
3
+ import { n as createReoptAiClient } from "./client-Dx3sYx7V.js";
4
+ import { n as createReoptAuthClient } from "./client-CP9RSAzn.js";
5
+ import { t as createReoptCmsClient } from "./client-CTefnLKY.js";
6
+ import { t as createReoptEavClient } from "./client-CHp-oNJB.js";
7
+ import { n as createReoptFeedbackClient } from "./client-SwByFT8p.js";
8
+ import { n as createReoptFileClient } from "./client-mvcEj1Vq.js";
9
+ import { n as createReoptAnalyticsClient } from "./client-2IaU8yUs.js";
10
+ import { n as createReoptPlansClient } from "./client-DE3FvPFs.js";
11
+ import { n as createReoptPushClient } from "./client-D_7G37OB.js";
12
+ import { n as createReoptTermsClient } from "./client-Dnp7_J0-.js";
12
13
 
13
14
  //#region src/singleton.ts
14
15
  let _instance;
@@ -117,6 +118,7 @@ function createReoptSDK(config) {
117
118
  debug: config.debug ?? false
118
119
  },
119
120
  ai: createReoptAiClient(config),
121
+ analytics: createReoptAnalyticsClient(config),
120
122
  auth: createReoptAuthClient(config),
121
123
  cms: createReoptCmsClient(config),
122
124
  eav: createReoptEavClient(config),
@@ -1,4 +1,4 @@
1
- import { a as resolveIdBaseUrl, x as ReoptSDKError } from "../config-D31PK7eu.js";
1
+ import { a as resolveIdBaseUrl, x as ReoptSDKError } from "../config-tEsB7QhQ.js";
2
2
 
3
3
  //#region src/logout/verify.ts
4
4
  /**
@@ -1,3 +1,3 @@
1
- import { n as createReoptPlansClient, t as ReoptPlansClient } from "../client-Djlg4STl.js";
1
+ import { n as createReoptPlansClient, t as ReoptPlansClient } from "../client-DE3FvPFs.js";
2
2
 
3
3
  export { ReoptPlansClient, createReoptPlansClient };
@@ -1,3 +1,3 @@
1
- import { n as createReoptPushClient, t as ReoptPushClient } from "../client-2qKKpHVy.js";
1
+ import { n as createReoptPushClient, t as ReoptPushClient } from "../client-D_7G37OB.js";
2
2
 
3
3
  export { ReoptPushClient, createReoptPushClient };
@@ -1,4 +1,4 @@
1
- import { x as ReoptSDKError } from "./config-D31PK7eu.js";
1
+ import { x as ReoptSDKError } from "./config-tEsB7QhQ.js";
2
2
 
3
3
  //#region src/core/query.ts
4
4
  /**
@@ -32,4 +32,4 @@ function buildQuery(params) {
32
32
 
33
33
  //#endregion
34
34
  export { buildQuery as t };
35
- //# sourceMappingURL=query-DyiwJX92.js.map
35
+ //# sourceMappingURL=query-Bsgb85OE.js.map
@@ -3,7 +3,7 @@ import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as
3
3
  import { _ as ReoptSDKError } from "../errors-CRCcErNC.js";
4
4
  import { a as ListTagsQuery, c as PostGroup, d as Tag, i as ListPostsQuery, o as Post, r as ListPostGroupsQuery, s as PostDetail, t as CmsPaginatedResponse } from "../types-BXDcoJHG.js";
5
5
  import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, u as UpdateFileInput } from "../client-A4YrHjDc.js";
6
- import { t as ReoptSDK } from "../index-CvNJ8zp1.js";
6
+ import { t as ReoptSDK } from "../index-DJMr3ixA.js";
7
7
  import { UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
8
8
  //#region src/react/use-ai-stream.d.ts
9
9
  type UseAiStreamOptions = {
@@ -1,3 +1,3 @@
1
- import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-DUvf9x_b.js";
1
+ import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-Dnp7_J0-.js";
2
2
 
3
3
  export { ReoptTermsClient, createReoptTermsClient };
@@ -1,5 +1,5 @@
1
1
  import { a as SeedAllInput, c as SeedPostGroupInput, d as SeedTermsItem, l as SeedPostInput, n as DevServer, o as SeedData, t as DevSchema } from "../index-DV_OWwx5.js";
2
- import { t as ReoptSDK } from "../index-CvNJ8zp1.js";
2
+ import { t as ReoptSDK } from "../index-DJMr3ixA.js";
3
3
  //#region src/testing/index.d.ts
4
4
  type TestSDKOptions = {
5
5
  /** EAV schema to seed entities and attributes */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reopt-ai/brandapp-sdk",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Reopt Brandapp SDK — Better Auth adapter, OAuth login, and EAV client",
5
5
  "author": "Reopt",
6
6
  "license": "MIT",
@@ -21,6 +21,10 @@
21
21
  "types": "./dist/ai-provider/index.d.ts",
22
22
  "import": "./dist/ai-provider/index.js"
23
23
  },
24
+ "./analytics": {
25
+ "types": "./dist/analytics/index.d.ts",
26
+ "import": "./dist/analytics/index.js"
27
+ },
24
28
  "./auth": {
25
29
  "types": "./dist/auth/index.d.ts",
26
30
  "import": "./dist/auth/index.js"
@@ -113,7 +117,8 @@
113
117
  "@tanstack/react-query": ">=5.0.0",
114
118
  "better-auth": "^1.7.1",
115
119
  "hono": ">=4.0.0",
116
- "react": ">=18.0.0"
120
+ "react": ">=18.0.0",
121
+ "@reopt-ai/data-sdk": ">=0.1.1"
117
122
  },
118
123
  "peerDependenciesMeta": {
119
124
  "@ai-sdk/provider": {
@@ -133,6 +138,9 @@
133
138
  },
134
139
  "react": {
135
140
  "optional": true
141
+ },
142
+ "@reopt-ai/data-sdk": {
143
+ "optional": true
136
144
  }
137
145
  },
138
146
  "devDependencies": {
@@ -146,6 +154,7 @@
146
154
  "tsdown": "^0.22.14",
147
155
  "typescript": "^7",
148
156
  "vitest": "^4.1.2",
157
+ "@reopt-ai/data-sdk": "^0.1.1",
149
158
  "@reopt/typescript-config": "0.0.0"
150
159
  },
151
160
  "keywords": [