authtara-sdk 1.1.10 → 1.1.12

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/react.d.mts CHANGED
@@ -7,6 +7,7 @@ interface User {
7
7
  email: string;
8
8
  name?: string | null;
9
9
  avatar?: string | null;
10
+ tenantId?: string;
10
11
  }
11
12
  interface AuthTaraConfig {
12
13
  appId: string;
@@ -53,6 +54,7 @@ interface AuthTaraAuthProps {
53
54
  declare function AuthTaraAuth({ appearance, redirectUrl, onSuccess, onError, }: AuthTaraAuthProps): react_jsx_runtime.JSX.Element;
54
55
 
55
56
  interface AuthTaraBillingProps {
57
+ tenantId: string;
56
58
  appearance?: {
57
59
  theme?: 'light' | 'dark';
58
60
  accentColor?: string;
@@ -60,9 +62,10 @@ interface AuthTaraBillingProps {
60
62
  onManagedPayment?: () => void;
61
63
  onUpgrade?: () => void;
62
64
  }
63
- declare function AuthTaraBilling({ appearance, onManagedPayment, onUpgrade, }: AuthTaraBillingProps): react_jsx_runtime.JSX.Element;
65
+ declare function AuthTaraBilling({ tenantId, appearance, onManagedPayment, onUpgrade, }: AuthTaraBillingProps): react_jsx_runtime.JSX.Element;
64
66
 
65
67
  interface AuthTaraPricingProps {
68
+ tenantId?: string;
66
69
  appearance?: {
67
70
  theme?: 'light' | 'dark';
68
71
  accentColor?: string;
package/dist/react.d.ts CHANGED
@@ -7,6 +7,7 @@ interface User {
7
7
  email: string;
8
8
  name?: string | null;
9
9
  avatar?: string | null;
10
+ tenantId?: string;
10
11
  }
11
12
  interface AuthTaraConfig {
12
13
  appId: string;
@@ -53,6 +54,7 @@ interface AuthTaraAuthProps {
53
54
  declare function AuthTaraAuth({ appearance, redirectUrl, onSuccess, onError, }: AuthTaraAuthProps): react_jsx_runtime.JSX.Element;
54
55
 
55
56
  interface AuthTaraBillingProps {
57
+ tenantId: string;
56
58
  appearance?: {
57
59
  theme?: 'light' | 'dark';
58
60
  accentColor?: string;
@@ -60,9 +62,10 @@ interface AuthTaraBillingProps {
60
62
  onManagedPayment?: () => void;
61
63
  onUpgrade?: () => void;
62
64
  }
63
- declare function AuthTaraBilling({ appearance, onManagedPayment, onUpgrade, }: AuthTaraBillingProps): react_jsx_runtime.JSX.Element;
65
+ declare function AuthTaraBilling({ tenantId, appearance, onManagedPayment, onUpgrade, }: AuthTaraBillingProps): react_jsx_runtime.JSX.Element;
64
66
 
65
67
  interface AuthTaraPricingProps {
68
+ tenantId?: string;
66
69
  appearance?: {
67
70
  theme?: 'light' | 'dark';
68
71
  accentColor?: string;
package/dist/react.js CHANGED
@@ -1001,6 +1001,7 @@ var Authtara = class {
1001
1001
  // src/components/AuthTaraBilling.tsx
1002
1002
  var import_jsx_runtime3 = require("react/jsx-runtime");
1003
1003
  function AuthTaraBilling({
1004
+ tenantId,
1004
1005
  appearance,
1005
1006
  onManagedPayment,
1006
1007
  onUpgrade
@@ -1011,7 +1012,7 @@ function AuthTaraBilling({
1011
1012
  const [isLoading, setIsLoading] = React3.useState(true);
1012
1013
  const [error, setError] = React3.useState(null);
1013
1014
  React3.useEffect(() => {
1014
- if (authLoading || !user) return;
1015
+ if (authLoading || !user || !tenantId) return;
1015
1016
  const fetchData = async () => {
1016
1017
  try {
1017
1018
  const ds = new Authtara({
@@ -1020,8 +1021,8 @@ function AuthTaraBilling({
1020
1021
  // Client-side, uses session cookies
1021
1022
  endpoint: apiUrl
1022
1023
  });
1023
- const subs = await ds.billing.listSubscriptions("");
1024
- const invs = await ds.billing.listInvoices("");
1024
+ const subs = await ds.billing.listSubscriptions(tenantId);
1025
+ const invs = await ds.billing.listInvoices(tenantId);
1025
1026
  setSubscriptions(subs);
1026
1027
  setInvoices(invs);
1027
1028
  } catch (err) {
@@ -1032,7 +1033,7 @@ function AuthTaraBilling({
1032
1033
  }
1033
1034
  };
1034
1035
  fetchData();
1035
- }, [authLoading, user, apiUrl, appId]);
1036
+ }, [authLoading, user, apiUrl, appId, tenantId]);
1036
1037
  if (authLoading || isLoading) {
1037
1038
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "3rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "authtara-spinner" }) });
1038
1039
  }
package/dist/react.mjs CHANGED
@@ -425,6 +425,7 @@ function AuthTaraAuth({
425
425
  import * as React3 from "react";
426
426
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
427
427
  function AuthTaraBilling({
428
+ tenantId,
428
429
  appearance,
429
430
  onManagedPayment,
430
431
  onUpgrade
@@ -435,7 +436,7 @@ function AuthTaraBilling({
435
436
  const [isLoading, setIsLoading] = React3.useState(true);
436
437
  const [error, setError] = React3.useState(null);
437
438
  React3.useEffect(() => {
438
- if (authLoading || !user) return;
439
+ if (authLoading || !user || !tenantId) return;
439
440
  const fetchData = async () => {
440
441
  try {
441
442
  const ds = new Authtara({
@@ -444,8 +445,8 @@ function AuthTaraBilling({
444
445
  // Client-side, uses session cookies
445
446
  endpoint: apiUrl
446
447
  });
447
- const subs = await ds.billing.listSubscriptions("");
448
- const invs = await ds.billing.listInvoices("");
448
+ const subs = await ds.billing.listSubscriptions(tenantId);
449
+ const invs = await ds.billing.listInvoices(tenantId);
449
450
  setSubscriptions(subs);
450
451
  setInvoices(invs);
451
452
  } catch (err) {
@@ -456,7 +457,7 @@ function AuthTaraBilling({
456
457
  }
457
458
  };
458
459
  fetchData();
459
- }, [authLoading, user, apiUrl, appId]);
460
+ }, [authLoading, user, apiUrl, appId, tenantId]);
460
461
  if (authLoading || isLoading) {
461
462
  return /* @__PURE__ */ jsx3("div", { style: { display: "flex", justifyContent: "center", padding: "3rem" }, children: /* @__PURE__ */ jsx3("div", { className: "authtara-spinner" }) });
462
463
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authtara-sdk",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "SDK Client untuk integrasi dengan DigitalSolution Platform - SSO, Billing, dan Metering",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",