@iqauth/sdk 2.1.0 → 2.3.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 (64) hide show
  1. package/README.md +43 -3
  2. package/dist/browser-session.d.mts +1 -2
  3. package/dist/browser-session.d.ts +1 -2
  4. package/dist/browser-session.js +89 -68
  5. package/dist/browser-session.mjs +2 -1
  6. package/dist/browser.d.mts +2 -2
  7. package/dist/browser.d.ts +2 -2
  8. package/dist/browser.js +69 -7
  9. package/dist/browser.mjs +2 -2
  10. package/dist/{chunk-ZESHDJDU.mjs → chunk-EKTNEZIH.mjs} +5 -8
  11. package/dist/{chunk-JQRTY5MY.mjs → chunk-KGEPDXHU.mjs} +12 -8
  12. package/dist/{chunk-S3M2IXCE.mjs → chunk-RACIPVLD.mjs} +15 -9
  13. package/dist/chunk-UNYDG2L4.mjs +209 -0
  14. package/dist/{chunk-MDUHPQMM.mjs → chunk-W3F4JYGP.mjs} +8 -180
  15. package/dist/chunk-WQWBJSSS.mjs +119 -0
  16. package/dist/cli/index.js +21 -0
  17. package/dist/cli/index.mjs +1 -1
  18. package/dist/{client-DXbHb2ul.d.ts → client-DTX4hNdS.d.ts} +16 -21
  19. package/dist/{client-Dv4v92Mj.d.mts → client-vdh2a9fJ.d.mts} +16 -21
  20. package/dist/{doctor-OHJRZBBT.mjs → doctor-A5E7LSFW.mjs} +2 -1
  21. package/dist/{express-BZmF1llh.d.mts → express-A0-dWEMy.d.mts} +1 -1
  22. package/dist/{express-B4o3P8vK.d.ts → express-Bo_pJKHN.d.ts} +1 -1
  23. package/dist/express.d.mts +75 -5
  24. package/dist/express.d.ts +75 -5
  25. package/dist/express.js +353 -94
  26. package/dist/express.mjs +210 -12
  27. package/dist/fastify.js +153 -88
  28. package/dist/fastify.mjs +10 -9
  29. package/dist/hono.js +152 -88
  30. package/dist/hono.mjs +9 -9
  31. package/dist/index.d.mts +3 -4
  32. package/dist/index.d.ts +3 -4
  33. package/dist/index.js +148 -72
  34. package/dist/index.mjs +16 -12
  35. package/dist/mobile.d.mts +1 -2
  36. package/dist/mobile.d.ts +1 -2
  37. package/dist/mobile.js +89 -68
  38. package/dist/mobile.mjs +2 -1
  39. package/dist/next.d.mts +9 -0
  40. package/dist/next.d.ts +9 -0
  41. package/dist/next.js +164 -1649
  42. package/dist/next.mjs +13 -16
  43. package/dist/{publishableKey-B5DIK81A.d.mts → publishableKey-BaR0HoAH.d.mts} +10 -1
  44. package/dist/{publishableKey-B5DIK81A.d.ts → publishableKey-BaR0HoAH.d.ts} +10 -1
  45. package/dist/react.d.mts +35 -3
  46. package/dist/react.d.ts +35 -3
  47. package/dist/react.js +78 -18
  48. package/dist/react.mjs +14 -2
  49. package/dist/server/handlers.d.mts +2 -0
  50. package/dist/server/handlers.d.ts +2 -0
  51. package/dist/server/handlers.js +72 -17
  52. package/dist/server/handlers.mjs +3 -2
  53. package/dist/server.d.mts +2 -3
  54. package/dist/server.d.ts +2 -3
  55. package/dist/server.js +151 -89
  56. package/dist/server.mjs +7 -6
  57. package/dist/service.d.mts +1 -2
  58. package/dist/service.d.ts +1 -2
  59. package/dist/service.js +89 -68
  60. package/dist/service.mjs +2 -1
  61. package/dist/{signIn-CEMdUAwd.d.mts → signIn-Cd0P4y9d.d.mts} +9 -1
  62. package/dist/{signIn-VRNzlNyG.d.ts → signIn-DKakyzeu.d.ts} +9 -1
  63. package/package.json +3 -2
  64. package/dist/chunk-5WFR6Y33.mjs +0 -59
package/dist/mobile.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  IQAuthClient
3
- } from "./chunk-MDUHPQMM.mjs";
3
+ } from "./chunk-W3F4JYGP.mjs";
4
+ import "./chunk-UNYDG2L4.mjs";
4
5
  import {
5
6
  ErrorCodes,
6
7
  IQAuthError
package/dist/next.d.mts CHANGED
@@ -25,6 +25,15 @@ declare function handler(options: IQAuthNextOptions): (req: Request) => Promise<
25
25
  /**
26
26
  * Edge-compatible Next.js middleware factory. Returns a function suitable
27
27
  * for `export const middleware = createMiddleware({ ... })`.
28
+ *
29
+ * Behavior: reads a Bearer token from the `Authorization` header or the
30
+ * access cookie (`iqauth_at` by default), verifies its signature against
31
+ * the issuer's JWKS using `jose` (Web Crypto, edge-safe), and on failure
32
+ * returns a 401 JSON response. The middleware does NOT transparently
33
+ * refresh expired access tokens — refresh happens in the browser SDK
34
+ * (single-flight) or by calling `POST /api/iqauth/refresh`. Pair this
35
+ * middleware with the helper routes mounted by `attachHelpers` for the
36
+ * full session lifecycle.
28
37
  */
29
38
  declare function createMiddleware(options: IQAuthNextOptions): (req: Request) => Promise<Response | undefined>;
30
39
  /**
package/dist/next.d.ts CHANGED
@@ -25,6 +25,15 @@ declare function handler(options: IQAuthNextOptions): (req: Request) => Promise<
25
25
  /**
26
26
  * Edge-compatible Next.js middleware factory. Returns a function suitable
27
27
  * for `export const middleware = createMiddleware({ ... })`.
28
+ *
29
+ * Behavior: reads a Bearer token from the `Authorization` header or the
30
+ * access cookie (`iqauth_at` by default), verifies its signature against
31
+ * the issuer's JWKS using `jose` (Web Crypto, edge-safe), and on failure
32
+ * returns a 401 JSON response. The middleware does NOT transparently
33
+ * refresh expired access tokens — refresh happens in the browser SDK
34
+ * (single-flight) or by calling `POST /api/iqauth/refresh`. Pair this
35
+ * middleware with the helper routes mounted by `attachHelpers` for the
36
+ * full session lifecycle.
28
37
  */
29
38
  declare function createMiddleware(options: IQAuthNextOptions): (req: Request) => Promise<Response | undefined>;
30
39
  /**