@stytch/nextjs 17.0.0 → 17.0.1

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
@@ -1,5 +1,12 @@
1
1
  # @stytch/nextjs
2
2
 
3
+ ## 17.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 50de202: Fix B2B headless entrypoint to import `@stytch/vanilla-js` rather than bundle it
8
+ - @stytch/vanilla-js@4.4.3
9
+
3
10
  ## 17.0.0
4
11
 
5
12
  ### Minor Changes
@@ -142,7 +142,7 @@ const useStytchIsAuthorized = (resourceId, action) => {
142
142
  fromCache: true,
143
143
  isAuthorized: client.rbac.isAuthorizedSync(resourceId, action),
144
144
  });
145
- }, []);
145
+ }, [action, client, resourceId, setIsAuthorized]);
146
146
  useEffect(() => {
147
147
  if (isStytchSSRProxy(client)) {
148
148
  return;
@@ -150,7 +150,7 @@ const useStytchIsAuthorized = (resourceId, action) => {
150
150
  client.rbac.isAuthorized(resourceId, action).then((isAuthorized) => {
151
151
  setIsAuthorized({ isAuthorized, fromCache: false, isInitialized: true });
152
152
  });
153
- }, [client, session === null || session === void 0 ? void 0 : session.roles, resourceId, action]);
153
+ }, [client, session === null || session === void 0 ? void 0 : session.roles, resourceId, action, setIsAuthorized]);
154
154
  return isAuthorized;
155
155
  };
156
156
  /**
@@ -233,7 +233,7 @@ const withStytchPermissions = (Component) => {
233
233
  client.rbac
234
234
  .allPermissions()
235
235
  .then((permissions) => setPermissions({ loaded: true, value: permissions }));
236
- }, [client, session === null || session === void 0 ? void 0 : session.roles]);
236
+ }, [client, session === null || session === void 0 ? void 0 : session.roles, setPermissions]);
237
237
  if (!permissions.loaded) {
238
238
  return null;
239
239
  }
@@ -360,6 +360,7 @@ const StytchB2B = ({ styles, callbacks, config }) => {
360
360
  elementId: `#${containerEl.current.id}`,
361
361
  styles,
362
362
  });
363
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- SDK-1354
363
364
  }, [stytchClient, styles, callbacks]);
364
365
  return React.createElement("div", { ref: containerEl });
365
366
  };
@@ -12,5 +12,5 @@ import { StytchB2BHeadlessClient } from "@stytch/vanilla-js/b2b/headless";
12
12
  * )
13
13
  * @returns A {@link StytchB2BHeadlessClient}
14
14
  */
15
- declare const createStytchB2BHeadlessClient: (_PUBLIC_TOKEN: string, options?: import("core/dist/public").StytchClientOptions | undefined) => StytchB2BHeadlessClient;
15
+ declare const createStytchB2BHeadlessClient: (_PUBLIC_TOKEN: string, options?: import("@stytch/core/dist/public").StytchClientOptions | undefined) => StytchB2BHeadlessClient;
16
16
  export { createStytchB2BHeadlessClient };
@@ -12,5 +12,5 @@ import { StytchB2BHeadlessClient } from "@stytch/vanilla-js/b2b/headless";
12
12
  * )
13
13
  * @returns A {@link StytchB2BHeadlessClient}
14
14
  */
15
- declare const createStytchB2BHeadlessClient: (_PUBLIC_TOKEN: string, options?: import("core/dist/public").StytchClientOptions | undefined) => StytchB2BHeadlessClient;
15
+ declare const createStytchB2BHeadlessClient: (_PUBLIC_TOKEN: string, options?: import("@stytch/core/dist/public").StytchClientOptions | undefined) => StytchB2BHeadlessClient;
16
16
  export { createStytchB2BHeadlessClient };