@stytch/nextjs 17.0.0 → 18.0.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/b2b/index.js CHANGED
@@ -150,7 +150,7 @@ const useStytchIsAuthorized = (resourceId, action) => {
150
150
  fromCache: true,
151
151
  isAuthorized: client.rbac.isAuthorizedSync(resourceId, action),
152
152
  });
153
- }, []);
153
+ }, [action, client, resourceId, setIsAuthorized]);
154
154
  React.useEffect(() => {
155
155
  if (isStytchSSRProxy(client)) {
156
156
  return;
@@ -158,7 +158,7 @@ const useStytchIsAuthorized = (resourceId, action) => {
158
158
  client.rbac.isAuthorized(resourceId, action).then((isAuthorized) => {
159
159
  setIsAuthorized({ isAuthorized, fromCache: false, isInitialized: true });
160
160
  });
161
- }, [client, session === null || session === void 0 ? void 0 : session.roles, resourceId, action]);
161
+ }, [client, session === null || session === void 0 ? void 0 : session.roles, resourceId, action, setIsAuthorized]);
162
162
  return isAuthorized;
163
163
  };
164
164
  /**
@@ -241,7 +241,7 @@ const withStytchPermissions = (Component) => {
241
241
  client.rbac
242
242
  .allPermissions()
243
243
  .then((permissions) => setPermissions({ loaded: true, value: permissions }));
244
- }, [client, session === null || session === void 0 ? void 0 : session.roles]);
244
+ }, [client, session === null || session === void 0 ? void 0 : session.roles, setPermissions]);
245
245
  if (!permissions.loaded) {
246
246
  return null;
247
247
  }
@@ -368,6 +368,7 @@ const StytchB2B = ({ styles, callbacks, config }) => {
368
368
  elementId: `#${containerEl.current.id}`,
369
369
  styles,
370
370
  });
371
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- SDK-1354
371
372
  }, [stytchClient, styles, callbacks]);
372
373
  return React__default['default'].createElement("div", { ref: containerEl });
373
374
  };
@@ -13,5 +13,5 @@ import { StytchB2BUIClient } from "@stytch/vanilla-js/b2b";
13
13
  * )
14
14
  * @returns A {@link StytchB2BUIClient}
15
15
  */
16
- declare const createStytchB2BUIClient: (_PUBLIC_TOKEN: string, options?: import("core/dist/public").StytchClientOptions | undefined) => StytchB2BUIClient;
16
+ declare const createStytchB2BUIClient: (_PUBLIC_TOKEN: string, options?: import("@stytch/core/dist/public").StytchClientOptions | undefined) => StytchB2BUIClient;
17
17
  export { createStytchB2BUIClient };
@@ -1,4 +1,3 @@
1
- import { StytchHeadlessClient } from "@stytch/vanilla-js/headless";
2
1
  /**
3
2
  * Creates a Headless Stytch client object to call the stytch APIs.
4
3
  * The Stytch client is not available serverside.
@@ -12,5 +11,5 @@ import { StytchHeadlessClient } from "@stytch/vanilla-js/headless";
12
11
  * )
13
12
  * @returns A {@link StytchHeadlessClient}
14
13
  */
15
- declare const createStytchHeadlessClient: (_PUBLIC_TOKEN: string, options?: import("@stytch/core/dist/public").StytchClientOptions | undefined) => StytchHeadlessClient;
14
+ declare const createStytchHeadlessClient: any;
16
15
  export { createStytchHeadlessClient };
@@ -1,4 +1,3 @@
1
- import { StytchHeadlessClient } from "@stytch/vanilla-js/headless";
2
1
  /**
3
2
  * Creates a Headless Stytch client object to call the stytch APIs.
4
3
  * The Stytch client is not available serverside.
@@ -12,5 +11,5 @@ import { StytchHeadlessClient } from "@stytch/vanilla-js/headless";
12
11
  * )
13
12
  * @returns A {@link StytchHeadlessClient}
14
13
  */
15
- declare const createStytchHeadlessClient: (_PUBLIC_TOKEN: string, options?: import("@stytch/core/dist/public").StytchClientOptions | undefined) => StytchHeadlessClient;
14
+ declare const createStytchHeadlessClient: any;
16
15
  export { createStytchHeadlessClient };
@@ -1,4 +1,3 @@
1
- import { StytchUIClient } from "@stytch/vanilla-js";
2
1
  /**
3
2
  * Creates a Stytch UI client object to call the Stytch APIs and render Stytch UI components.
4
3
  * The Stytch client is not available serverside.
@@ -13,5 +12,5 @@ import { StytchUIClient } from "@stytch/vanilla-js";
13
12
  * )
14
13
  * @returns A {@link StytchUIClient}
15
14
  */
16
- declare const createStytchUIClient: (_PUBLIC_TOKEN: string, options?: import("@stytch/core/dist/public").StytchClientOptions | undefined) => StytchUIClient;
15
+ declare const createStytchUIClient: any;
17
16
  export { createStytchUIClient };
@@ -1,4 +1,3 @@
1
- import { StytchUIClient } from "@stytch/vanilla-js";
2
1
  /**
3
2
  * Creates a Stytch UI client object to call the Stytch APIs and render Stytch UI components.
4
3
  * The Stytch client is not available serverside.
@@ -13,5 +12,5 @@ import { StytchUIClient } from "@stytch/vanilla-js";
13
12
  * )
14
13
  * @returns A {@link StytchUIClient}
15
14
  */
16
- declare const createStytchUIClient: (_PUBLIC_TOKEN: string, options?: import("@stytch/core/dist/public").StytchClientOptions | undefined) => StytchUIClient;
15
+ declare const createStytchUIClient: any;
17
16
  export { createStytchUIClient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stytch/nextjs",
3
- "version": "17.0.0",
3
+ "version": "18.0.0",
4
4
  "description": "Stytch's official Next.js Library",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -22,16 +22,17 @@
22
22
  "author": "Stytch",
23
23
  "devDependencies": {
24
24
  "@babel/runtime": "7.18.6",
25
- "@stytch/vanilla-js": "4.2.0",
25
+ "@stytch/vanilla-js": "4.7.0",
26
26
  "@testing-library/react": "14.0.0",
27
27
  "eslint-config-custom": "0.0.1",
28
- "react-dom": ">= 17.0.2",
28
+ "react": "18.2.0",
29
+ "react-dom": "18.2.0",
29
30
  "react-test-renderer": "18.0.0",
30
31
  "rollup": "2.56.3",
31
- "typescript": "4.7.4"
32
+ "typescript": "5.3.3"
32
33
  },
33
34
  "peerDependencies": {
34
- "@stytch/vanilla-js": "^4.2.0",
35
+ "@stytch/vanilla-js": "^4.7.0",
35
36
  "react": ">= 17.0.2",
36
37
  "react-dom": ">= 17.0.2"
37
38
  },