@multiplatform.one/keycloak 5.0.26 → 6.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.
Files changed (580) hide show
  1. package/dist/cjs/index.cjs +881 -17
  2. package/dist/esm/index.js +855 -8
  3. package/package.json +59 -55
  4. package/src/@types/expo_keycloak_auth.d.ts +4 -0
  5. package/src/Authenticated.tsx +1 -25
  6. package/src/Loading.tsx +0 -21
  7. package/src/authConfig.ts +0 -21
  8. package/src/betterAuth/client.ts +22 -0
  9. package/src/betterAuth/expoClient.ts +35 -0
  10. package/src/betterAuth/index.ts +2 -0
  11. package/src/hooks/index.ts +0 -21
  12. package/src/hooks/useAuthConfig.ts +0 -21
  13. package/src/hooks/useTokensFromQuery/index.native.ts +0 -21
  14. package/src/hooks/useTokensFromQuery/index.ts +1 -22
  15. package/src/hooks/useTokensFromState.ts +0 -22
  16. package/src/index.ts +1 -42
  17. package/src/keycloak/base.ts +3 -26
  18. package/src/keycloak/config.ts +7 -23
  19. package/src/keycloak/context.ts +0 -21
  20. package/src/keycloak/index.native.ts +1 -22
  21. package/src/keycloak/index.ts +29 -97
  22. package/src/keycloak/index.webext.ts +23 -25
  23. package/src/one.ts +60 -146
  24. package/src/provider/AfterAuth.tsx +10 -29
  25. package/src/provider/KeycloakProvider.tsx +2 -23
  26. package/src/provider/authProvider/index.native.tsx +116 -0
  27. package/src/provider/{AuthProvider → authProvider}/index.tsx +26 -57
  28. package/src/provider/{AuthProvider → authProvider}/index.webext.tsx +36 -86
  29. package/src/provider/{AuthProvider → authProvider}/shared.ts +5 -20
  30. package/src/provider/index.ts +1 -22
  31. package/src/session/index.native.ts +8 -20
  32. package/src/session/index.ts +46 -44
  33. package/src/session/index.webext.ts +7 -21
  34. package/src/state.ts +29 -30
  35. package/src/token.spec.ts +168 -0
  36. package/src/token.ts +146 -23
  37. package/src/types.ts +0 -21
  38. package/dist/cjs/Authenticated.cjs +0 -83
  39. package/dist/cjs/Authenticated.js +0 -54
  40. package/dist/cjs/Authenticated.js.map +0 -6
  41. package/dist/cjs/Authenticated.native.js +0 -73
  42. package/dist/cjs/Authenticated.native.js.map +0 -6
  43. package/dist/cjs/Loading.cjs +0 -39
  44. package/dist/cjs/Loading.js +0 -25
  45. package/dist/cjs/Loading.js.map +0 -6
  46. package/dist/cjs/Loading.native.js +0 -32
  47. package/dist/cjs/Loading.native.js.map +0 -6
  48. package/dist/cjs/authConfig.cjs +0 -29
  49. package/dist/cjs/authConfig.js +0 -23
  50. package/dist/cjs/authConfig.js.map +0 -6
  51. package/dist/cjs/authConfig.native.js +0 -28
  52. package/dist/cjs/authConfig.native.js.map +0 -6
  53. package/dist/cjs/hooks/index.cjs +0 -20
  54. package/dist/cjs/hooks/index.js +0 -17
  55. package/dist/cjs/hooks/index.js.map +0 -6
  56. package/dist/cjs/hooks/index.native.js +0 -24
  57. package/dist/cjs/hooks/index.native.js.map +0 -6
  58. package/dist/cjs/hooks/useAuthConfig.cjs +0 -30
  59. package/dist/cjs/hooks/useAuthConfig.js +0 -24
  60. package/dist/cjs/hooks/useAuthConfig.js.map +0 -6
  61. package/dist/cjs/hooks/useAuthConfig.native.js +0 -29
  62. package/dist/cjs/hooks/useAuthConfig.native.js.map +0 -6
  63. package/dist/cjs/hooks/useTokensFromQuery/index.cjs +0 -35
  64. package/dist/cjs/hooks/useTokensFromQuery/index.js +0 -29
  65. package/dist/cjs/hooks/useTokensFromQuery/index.js.map +0 -6
  66. package/dist/cjs/hooks/useTokensFromQuery/index.native.js +0 -28
  67. package/dist/cjs/hooks/useTokensFromQuery/index.native.js.map +0 -6
  68. package/dist/cjs/hooks/useTokensFromState.cjs +0 -31
  69. package/dist/cjs/hooks/useTokensFromState.js +0 -26
  70. package/dist/cjs/hooks/useTokensFromState.js.map +0 -6
  71. package/dist/cjs/hooks/useTokensFromState.native.js +0 -31
  72. package/dist/cjs/hooks/useTokensFromState.native.js.map +0 -6
  73. package/dist/cjs/index.js +0 -21
  74. package/dist/cjs/index.js.map +0 -6
  75. package/dist/cjs/index.native.js +0 -32
  76. package/dist/cjs/index.native.js.map +0 -6
  77. package/dist/cjs/keycloak/base.cjs +0 -90
  78. package/dist/cjs/keycloak/base.js +0 -90
  79. package/dist/cjs/keycloak/base.js.map +0 -6
  80. package/dist/cjs/keycloak/base.native.js +0 -135
  81. package/dist/cjs/keycloak/base.native.js.map +0 -6
  82. package/dist/cjs/keycloak/config.cjs +0 -31
  83. package/dist/cjs/keycloak/config.js +0 -26
  84. package/dist/cjs/keycloak/config.js.map +0 -6
  85. package/dist/cjs/keycloak/config.native.js +0 -30
  86. package/dist/cjs/keycloak/config.native.js.map +0 -6
  87. package/dist/cjs/keycloak/context.cjs +0 -27
  88. package/dist/cjs/keycloak/context.js +0 -22
  89. package/dist/cjs/keycloak/context.js.map +0 -6
  90. package/dist/cjs/keycloak/context.native.js +0 -26
  91. package/dist/cjs/keycloak/context.native.js.map +0 -6
  92. package/dist/cjs/keycloak/index.cjs +0 -131
  93. package/dist/cjs/keycloak/index.electron.cjs +0 -54
  94. package/dist/cjs/keycloak/index.electron.js +0 -40
  95. package/dist/cjs/keycloak/index.electron.js.map +0 -6
  96. package/dist/cjs/keycloak/index.electron.native.js +0 -137
  97. package/dist/cjs/keycloak/index.electron.native.js.map +0 -6
  98. package/dist/cjs/keycloak/index.js +0 -100
  99. package/dist/cjs/keycloak/index.js.map +0 -6
  100. package/dist/cjs/keycloak/index.native.js +0 -100
  101. package/dist/cjs/keycloak/index.native.js.map +0 -6
  102. package/dist/cjs/keycloak/index.webext.cjs +0 -54
  103. package/dist/cjs/keycloak/index.webext.js +0 -40
  104. package/dist/cjs/keycloak/index.webext.js.map +0 -6
  105. package/dist/cjs/keycloak/index.webext.native.js +0 -137
  106. package/dist/cjs/keycloak/index.webext.native.js.map +0 -6
  107. package/dist/cjs/one.cjs +0 -121
  108. package/dist/cjs/one.js +0 -119
  109. package/dist/cjs/one.js.map +0 -6
  110. package/dist/cjs/one.native.js +0 -125
  111. package/dist/cjs/one.native.js.map +0 -6
  112. package/dist/cjs/provider/AfterAuth.cjs +0 -57
  113. package/dist/cjs/provider/AfterAuth.js +0 -44
  114. package/dist/cjs/provider/AfterAuth.js.map +0 -6
  115. package/dist/cjs/provider/AfterAuth.native.js +0 -68
  116. package/dist/cjs/provider/AfterAuth.native.js.map +0 -6
  117. package/dist/cjs/provider/AuthProvider/index.cjs +0 -223
  118. package/dist/cjs/provider/AuthProvider/index.electron.cjs +0 -223
  119. package/dist/cjs/provider/AuthProvider/index.electron.js +0 -244
  120. package/dist/cjs/provider/AuthProvider/index.electron.js.map +0 -6
  121. package/dist/cjs/provider/AuthProvider/index.electron.native.js +0 -299
  122. package/dist/cjs/provider/AuthProvider/index.electron.native.js.map +0 -6
  123. package/dist/cjs/provider/AuthProvider/index.js +0 -241
  124. package/dist/cjs/provider/AuthProvider/index.js.map +0 -6
  125. package/dist/cjs/provider/AuthProvider/index.native.js +0 -198
  126. package/dist/cjs/provider/AuthProvider/index.native.js.map +0 -6
  127. package/dist/cjs/provider/AuthProvider/index.webext.cjs +0 -223
  128. package/dist/cjs/provider/AuthProvider/index.webext.js +0 -244
  129. package/dist/cjs/provider/AuthProvider/index.webext.js.map +0 -6
  130. package/dist/cjs/provider/AuthProvider/index.webext.native.js +0 -299
  131. package/dist/cjs/provider/AuthProvider/index.webext.native.js.map +0 -6
  132. package/dist/cjs/provider/AuthProvider/shared.cjs +0 -36
  133. package/dist/cjs/provider/AuthProvider/shared.js +0 -30
  134. package/dist/cjs/provider/AuthProvider/shared.js.map +0 -6
  135. package/dist/cjs/provider/AuthProvider/shared.native.js +0 -40
  136. package/dist/cjs/provider/AuthProvider/shared.native.js.map +0 -6
  137. package/dist/cjs/provider/KeycloakProvider.cjs +0 -60
  138. package/dist/cjs/provider/KeycloakProvider.js +0 -50
  139. package/dist/cjs/provider/KeycloakProvider.js.map +0 -6
  140. package/dist/cjs/provider/KeycloakProvider.native.js +0 -54
  141. package/dist/cjs/provider/KeycloakProvider.native.js.map +0 -6
  142. package/dist/cjs/provider/index.cjs +0 -20
  143. package/dist/cjs/provider/index.js +0 -17
  144. package/dist/cjs/provider/index.js.map +0 -6
  145. package/dist/cjs/provider/index.native.js +0 -24
  146. package/dist/cjs/provider/index.native.js.map +0 -6
  147. package/dist/cjs/session/index.cjs +0 -36
  148. package/dist/cjs/session/index.electron.cjs +0 -32
  149. package/dist/cjs/session/index.electron.js +0 -27
  150. package/dist/cjs/session/index.electron.js.map +0 -6
  151. package/dist/cjs/session/index.electron.native.js +0 -33
  152. package/dist/cjs/session/index.electron.native.js.map +0 -6
  153. package/dist/cjs/session/index.js +0 -30
  154. package/dist/cjs/session/index.js.map +0 -6
  155. package/dist/cjs/session/index.native.js +0 -33
  156. package/dist/cjs/session/index.native.js.map +0 -6
  157. package/dist/cjs/session/index.webext.cjs +0 -32
  158. package/dist/cjs/session/index.webext.js +0 -27
  159. package/dist/cjs/session/index.webext.js.map +0 -6
  160. package/dist/cjs/session/index.webext.native.js +0 -33
  161. package/dist/cjs/session/index.webext.native.js.map +0 -6
  162. package/dist/cjs/state.cjs +0 -37
  163. package/dist/cjs/state.js +0 -31
  164. package/dist/cjs/state.js.map +0 -6
  165. package/dist/cjs/state.native.js +0 -46
  166. package/dist/cjs/state.native.js.map +0 -6
  167. package/dist/cjs/token.cjs +0 -36
  168. package/dist/cjs/token.js +0 -30
  169. package/dist/cjs/token.js.map +0 -6
  170. package/dist/cjs/token.native.js +0 -36
  171. package/dist/cjs/token.native.js.map +0 -6
  172. package/dist/cjs/types.cjs +0 -16
  173. package/dist/cjs/types.js +0 -14
  174. package/dist/cjs/types.js.map +0 -6
  175. package/dist/cjs/types.native.js +0 -15
  176. package/dist/cjs/types.native.js.map +0 -6
  177. package/dist/esm/Authenticated.js +0 -36
  178. package/dist/esm/Authenticated.js.map +0 -6
  179. package/dist/esm/Authenticated.mjs +0 -48
  180. package/dist/esm/Authenticated.mjs.map +0 -1
  181. package/dist/esm/Authenticated.native.js +0 -49
  182. package/dist/esm/Authenticated.native.js.map +0 -6
  183. package/dist/esm/Loading.js +0 -11
  184. package/dist/esm/Loading.js.map +0 -6
  185. package/dist/esm/Loading.mjs +0 -16
  186. package/dist/esm/Loading.mjs.map +0 -1
  187. package/dist/esm/Loading.native.js +0 -13
  188. package/dist/esm/Loading.native.js.map +0 -6
  189. package/dist/esm/authConfig.js +0 -7
  190. package/dist/esm/authConfig.js.map +0 -6
  191. package/dist/esm/authConfig.mjs +0 -5
  192. package/dist/esm/authConfig.mjs.map +0 -1
  193. package/dist/esm/authConfig.native.js +0 -7
  194. package/dist/esm/authConfig.native.js.map +0 -6
  195. package/dist/esm/hooks/index.js +0 -4
  196. package/dist/esm/hooks/index.js.map +0 -6
  197. package/dist/esm/hooks/index.mjs +0 -4
  198. package/dist/esm/hooks/index.mjs.map +0 -1
  199. package/dist/esm/hooks/index.native.js +0 -4
  200. package/dist/esm/hooks/index.native.js.map +0 -6
  201. package/dist/esm/hooks/useAuthConfig.js +0 -9
  202. package/dist/esm/hooks/useAuthConfig.js.map +0 -6
  203. package/dist/esm/hooks/useAuthConfig.mjs +0 -7
  204. package/dist/esm/hooks/useAuthConfig.mjs.map +0 -1
  205. package/dist/esm/hooks/useAuthConfig.native.js +0 -9
  206. package/dist/esm/hooks/useAuthConfig.native.js.map +0 -6
  207. package/dist/esm/hooks/useTokensFromQuery/index.js +0 -14
  208. package/dist/esm/hooks/useTokensFromQuery/index.js.map +0 -6
  209. package/dist/esm/hooks/useTokensFromQuery/index.mjs +0 -12
  210. package/dist/esm/hooks/useTokensFromQuery/index.mjs.map +0 -1
  211. package/dist/esm/hooks/useTokensFromQuery/index.native.js +0 -7
  212. package/dist/esm/hooks/useTokensFromQuery/index.native.js.map +0 -6
  213. package/dist/esm/hooks/useTokensFromState.js +0 -11
  214. package/dist/esm/hooks/useTokensFromState.js.map +0 -6
  215. package/dist/esm/hooks/useTokensFromState.mjs +0 -8
  216. package/dist/esm/hooks/useTokensFromState.mjs.map +0 -1
  217. package/dist/esm/hooks/useTokensFromState.native.js +0 -11
  218. package/dist/esm/hooks/useTokensFromState.native.js.map +0 -6
  219. package/dist/esm/index.js.map +0 -6
  220. package/dist/esm/index.mjs +0 -8
  221. package/dist/esm/index.mjs.map +0 -1
  222. package/dist/esm/index.native.js +0 -8
  223. package/dist/esm/index.native.js.map +0 -6
  224. package/dist/esm/keycloak/base.js +0 -77
  225. package/dist/esm/keycloak/base.js.map +0 -6
  226. package/dist/esm/keycloak/base.mjs +0 -66
  227. package/dist/esm/keycloak/base.mjs.map +0 -1
  228. package/dist/esm/keycloak/base.native.js +0 -116
  229. package/dist/esm/keycloak/base.native.js.map +0 -6
  230. package/dist/esm/keycloak/config.js +0 -10
  231. package/dist/esm/keycloak/config.js.map +0 -6
  232. package/dist/esm/keycloak/config.mjs +0 -8
  233. package/dist/esm/keycloak/config.mjs.map +0 -1
  234. package/dist/esm/keycloak/config.native.js +0 -10
  235. package/dist/esm/keycloak/config.native.js.map +0 -6
  236. package/dist/esm/keycloak/context.js +0 -6
  237. package/dist/esm/keycloak/context.js.map +0 -6
  238. package/dist/esm/keycloak/context.mjs +0 -4
  239. package/dist/esm/keycloak/context.mjs.map +0 -1
  240. package/dist/esm/keycloak/context.native.js +0 -6
  241. package/dist/esm/keycloak/context.native.js.map +0 -6
  242. package/dist/esm/keycloak/index.electron.js +0 -30
  243. package/dist/esm/keycloak/index.electron.js.map +0 -6
  244. package/dist/esm/keycloak/index.electron.mjs +0 -29
  245. package/dist/esm/keycloak/index.electron.mjs.map +0 -1
  246. package/dist/esm/keycloak/index.electron.native.js +0 -117
  247. package/dist/esm/keycloak/index.electron.native.js.map +0 -6
  248. package/dist/esm/keycloak/index.js +0 -98
  249. package/dist/esm/keycloak/index.js.map +0 -6
  250. package/dist/esm/keycloak/index.mjs +0 -105
  251. package/dist/esm/keycloak/index.mjs.map +0 -1
  252. package/dist/esm/keycloak/index.native.js +0 -81
  253. package/dist/esm/keycloak/index.native.js.map +0 -6
  254. package/dist/esm/keycloak/index.webext.js +0 -30
  255. package/dist/esm/keycloak/index.webext.js.map +0 -6
  256. package/dist/esm/keycloak/index.webext.mjs +0 -29
  257. package/dist/esm/keycloak/index.webext.mjs.map +0 -1
  258. package/dist/esm/keycloak/index.webext.native.js +0 -117
  259. package/dist/esm/keycloak/index.webext.native.js.map +0 -6
  260. package/dist/esm/one.js +0 -96
  261. package/dist/esm/one.js.map +0 -6
  262. package/dist/esm/one.mjs +0 -87
  263. package/dist/esm/one.mjs.map +0 -1
  264. package/dist/esm/one.native.js +0 -98
  265. package/dist/esm/one.native.js.map +0 -6
  266. package/dist/esm/provider/AfterAuth.js +0 -34
  267. package/dist/esm/provider/AfterAuth.js.map +0 -6
  268. package/dist/esm/provider/AfterAuth.mjs +0 -34
  269. package/dist/esm/provider/AfterAuth.mjs.map +0 -1
  270. package/dist/esm/provider/AfterAuth.native.js +0 -53
  271. package/dist/esm/provider/AfterAuth.native.js.map +0 -6
  272. package/dist/esm/provider/AuthProvider/index.electron.js +0 -231
  273. package/dist/esm/provider/AuthProvider/index.electron.js.map +0 -6
  274. package/dist/esm/provider/AuthProvider/index.electron.mjs +0 -189
  275. package/dist/esm/provider/AuthProvider/index.electron.mjs.map +0 -1
  276. package/dist/esm/provider/AuthProvider/index.electron.native.js +0 -281
  277. package/dist/esm/provider/AuthProvider/index.electron.native.js.map +0 -6
  278. package/dist/esm/provider/AuthProvider/index.js +0 -229
  279. package/dist/esm/provider/AuthProvider/index.js.map +0 -6
  280. package/dist/esm/provider/AuthProvider/index.mjs +0 -189
  281. package/dist/esm/provider/AuthProvider/index.mjs.map +0 -1
  282. package/dist/esm/provider/AuthProvider/index.native.js +0 -186
  283. package/dist/esm/provider/AuthProvider/index.native.js.map +0 -6
  284. package/dist/esm/provider/AuthProvider/index.webext.js +0 -231
  285. package/dist/esm/provider/AuthProvider/index.webext.js.map +0 -6
  286. package/dist/esm/provider/AuthProvider/index.webext.mjs +0 -189
  287. package/dist/esm/provider/AuthProvider/index.webext.mjs.map +0 -1
  288. package/dist/esm/provider/AuthProvider/index.webext.native.js +0 -281
  289. package/dist/esm/provider/AuthProvider/index.webext.native.js.map +0 -6
  290. package/dist/esm/provider/AuthProvider/shared.js +0 -14
  291. package/dist/esm/provider/AuthProvider/shared.js.map +0 -6
  292. package/dist/esm/provider/AuthProvider/shared.mjs +0 -11
  293. package/dist/esm/provider/AuthProvider/shared.mjs.map +0 -1
  294. package/dist/esm/provider/AuthProvider/shared.native.js +0 -17
  295. package/dist/esm/provider/AuthProvider/shared.native.js.map +0 -6
  296. package/dist/esm/provider/KeycloakProvider.js +0 -37
  297. package/dist/esm/provider/KeycloakProvider.js.map +0 -6
  298. package/dist/esm/provider/KeycloakProvider.mjs +0 -37
  299. package/dist/esm/provider/KeycloakProvider.mjs.map +0 -1
  300. package/dist/esm/provider/KeycloakProvider.native.js +0 -36
  301. package/dist/esm/provider/KeycloakProvider.native.js.map +0 -6
  302. package/dist/esm/provider/index.js +0 -4
  303. package/dist/esm/provider/index.js.map +0 -6
  304. package/dist/esm/provider/index.mjs +0 -4
  305. package/dist/esm/provider/index.mjs.map +0 -1
  306. package/dist/esm/provider/index.native.js +0 -4
  307. package/dist/esm/provider/index.native.js.map +0 -6
  308. package/dist/esm/session/index.electron.js +0 -11
  309. package/dist/esm/session/index.electron.js.map +0 -6
  310. package/dist/esm/session/index.electron.mjs +0 -8
  311. package/dist/esm/session/index.electron.mjs.map +0 -1
  312. package/dist/esm/session/index.electron.native.js +0 -11
  313. package/dist/esm/session/index.electron.native.js.map +0 -6
  314. package/dist/esm/session/index.js +0 -15
  315. package/dist/esm/session/index.js.map +0 -6
  316. package/dist/esm/session/index.mjs +0 -13
  317. package/dist/esm/session/index.mjs.map +0 -1
  318. package/dist/esm/session/index.native.js +0 -11
  319. package/dist/esm/session/index.native.js.map +0 -6
  320. package/dist/esm/session/index.webext.js +0 -11
  321. package/dist/esm/session/index.webext.js.map +0 -6
  322. package/dist/esm/session/index.webext.mjs +0 -8
  323. package/dist/esm/session/index.webext.mjs.map +0 -1
  324. package/dist/esm/session/index.webext.native.js +0 -11
  325. package/dist/esm/session/index.webext.native.js.map +0 -6
  326. package/dist/esm/state.js +0 -16
  327. package/dist/esm/state.js.map +0 -6
  328. package/dist/esm/state.mjs +0 -13
  329. package/dist/esm/state.mjs.map +0 -1
  330. package/dist/esm/state.native.js +0 -25
  331. package/dist/esm/state.native.js.map +0 -6
  332. package/dist/esm/token.js +0 -14
  333. package/dist/esm/token.js.map +0 -6
  334. package/dist/esm/token.mjs +0 -12
  335. package/dist/esm/token.mjs.map +0 -1
  336. package/dist/esm/token.native.js +0 -14
  337. package/dist/esm/token.native.js.map +0 -6
  338. package/dist/esm/types.js +0 -1
  339. package/dist/esm/types.js.map +0 -6
  340. package/dist/esm/types.mjs +0 -2
  341. package/dist/esm/types.mjs.map +0 -1
  342. package/dist/esm/types.native.js +0 -1
  343. package/dist/esm/types.native.js.map +0 -6
  344. package/dist/jsx/Authenticated.js +0 -36
  345. package/dist/jsx/Authenticated.js.map +0 -6
  346. package/dist/jsx/Authenticated.mjs +0 -48
  347. package/dist/jsx/Authenticated.mjs.map +0 -1
  348. package/dist/jsx/Authenticated.native.js +0 -49
  349. package/dist/jsx/Authenticated.native.js.map +0 -6
  350. package/dist/jsx/Loading.js +0 -11
  351. package/dist/jsx/Loading.js.map +0 -6
  352. package/dist/jsx/Loading.mjs +0 -16
  353. package/dist/jsx/Loading.mjs.map +0 -1
  354. package/dist/jsx/Loading.native.js +0 -13
  355. package/dist/jsx/Loading.native.js.map +0 -6
  356. package/dist/jsx/authConfig.js +0 -7
  357. package/dist/jsx/authConfig.js.map +0 -6
  358. package/dist/jsx/authConfig.mjs +0 -5
  359. package/dist/jsx/authConfig.mjs.map +0 -1
  360. package/dist/jsx/authConfig.native.js +0 -7
  361. package/dist/jsx/authConfig.native.js.map +0 -6
  362. package/dist/jsx/hooks/index.js +0 -4
  363. package/dist/jsx/hooks/index.js.map +0 -6
  364. package/dist/jsx/hooks/index.mjs +0 -4
  365. package/dist/jsx/hooks/index.mjs.map +0 -1
  366. package/dist/jsx/hooks/index.native.js +0 -4
  367. package/dist/jsx/hooks/index.native.js.map +0 -6
  368. package/dist/jsx/hooks/useAuthConfig.js +0 -9
  369. package/dist/jsx/hooks/useAuthConfig.js.map +0 -6
  370. package/dist/jsx/hooks/useAuthConfig.mjs +0 -7
  371. package/dist/jsx/hooks/useAuthConfig.mjs.map +0 -1
  372. package/dist/jsx/hooks/useAuthConfig.native.js +0 -9
  373. package/dist/jsx/hooks/useAuthConfig.native.js.map +0 -6
  374. package/dist/jsx/hooks/useTokensFromQuery/index.js +0 -14
  375. package/dist/jsx/hooks/useTokensFromQuery/index.js.map +0 -6
  376. package/dist/jsx/hooks/useTokensFromQuery/index.mjs +0 -12
  377. package/dist/jsx/hooks/useTokensFromQuery/index.mjs.map +0 -1
  378. package/dist/jsx/hooks/useTokensFromQuery/index.native.js +0 -7
  379. package/dist/jsx/hooks/useTokensFromQuery/index.native.js.map +0 -6
  380. package/dist/jsx/hooks/useTokensFromState.js +0 -11
  381. package/dist/jsx/hooks/useTokensFromState.js.map +0 -6
  382. package/dist/jsx/hooks/useTokensFromState.mjs +0 -8
  383. package/dist/jsx/hooks/useTokensFromState.mjs.map +0 -1
  384. package/dist/jsx/hooks/useTokensFromState.native.js +0 -11
  385. package/dist/jsx/hooks/useTokensFromState.native.js.map +0 -6
  386. package/dist/jsx/index.js +0 -8
  387. package/dist/jsx/index.js.map +0 -6
  388. package/dist/jsx/index.mjs +0 -8
  389. package/dist/jsx/index.mjs.map +0 -1
  390. package/dist/jsx/index.native.js +0 -8
  391. package/dist/jsx/index.native.js.map +0 -6
  392. package/dist/jsx/keycloak/base.js +0 -77
  393. package/dist/jsx/keycloak/base.js.map +0 -6
  394. package/dist/jsx/keycloak/base.mjs +0 -66
  395. package/dist/jsx/keycloak/base.mjs.map +0 -1
  396. package/dist/jsx/keycloak/base.native.js +0 -116
  397. package/dist/jsx/keycloak/base.native.js.map +0 -6
  398. package/dist/jsx/keycloak/config.js +0 -10
  399. package/dist/jsx/keycloak/config.js.map +0 -6
  400. package/dist/jsx/keycloak/config.mjs +0 -8
  401. package/dist/jsx/keycloak/config.mjs.map +0 -1
  402. package/dist/jsx/keycloak/config.native.js +0 -10
  403. package/dist/jsx/keycloak/config.native.js.map +0 -6
  404. package/dist/jsx/keycloak/context.js +0 -6
  405. package/dist/jsx/keycloak/context.js.map +0 -6
  406. package/dist/jsx/keycloak/context.mjs +0 -4
  407. package/dist/jsx/keycloak/context.mjs.map +0 -1
  408. package/dist/jsx/keycloak/context.native.js +0 -6
  409. package/dist/jsx/keycloak/context.native.js.map +0 -6
  410. package/dist/jsx/keycloak/index.electron.js +0 -30
  411. package/dist/jsx/keycloak/index.electron.js.map +0 -6
  412. package/dist/jsx/keycloak/index.electron.mjs +0 -29
  413. package/dist/jsx/keycloak/index.electron.mjs.map +0 -1
  414. package/dist/jsx/keycloak/index.electron.native.js +0 -117
  415. package/dist/jsx/keycloak/index.electron.native.js.map +0 -6
  416. package/dist/jsx/keycloak/index.js +0 -98
  417. package/dist/jsx/keycloak/index.js.map +0 -6
  418. package/dist/jsx/keycloak/index.mjs +0 -105
  419. package/dist/jsx/keycloak/index.mjs.map +0 -1
  420. package/dist/jsx/keycloak/index.native.js +0 -81
  421. package/dist/jsx/keycloak/index.native.js.map +0 -6
  422. package/dist/jsx/keycloak/index.webext.js +0 -30
  423. package/dist/jsx/keycloak/index.webext.js.map +0 -6
  424. package/dist/jsx/keycloak/index.webext.mjs +0 -29
  425. package/dist/jsx/keycloak/index.webext.mjs.map +0 -1
  426. package/dist/jsx/keycloak/index.webext.native.js +0 -117
  427. package/dist/jsx/keycloak/index.webext.native.js.map +0 -6
  428. package/dist/jsx/one.js +0 -96
  429. package/dist/jsx/one.js.map +0 -6
  430. package/dist/jsx/one.mjs +0 -87
  431. package/dist/jsx/one.mjs.map +0 -1
  432. package/dist/jsx/one.native.js +0 -98
  433. package/dist/jsx/one.native.js.map +0 -6
  434. package/dist/jsx/provider/AfterAuth.js +0 -34
  435. package/dist/jsx/provider/AfterAuth.js.map +0 -6
  436. package/dist/jsx/provider/AfterAuth.mjs +0 -34
  437. package/dist/jsx/provider/AfterAuth.mjs.map +0 -1
  438. package/dist/jsx/provider/AfterAuth.native.js +0 -53
  439. package/dist/jsx/provider/AfterAuth.native.js.map +0 -6
  440. package/dist/jsx/provider/AuthProvider/index.electron.js +0 -231
  441. package/dist/jsx/provider/AuthProvider/index.electron.js.map +0 -6
  442. package/dist/jsx/provider/AuthProvider/index.electron.mjs +0 -189
  443. package/dist/jsx/provider/AuthProvider/index.electron.mjs.map +0 -1
  444. package/dist/jsx/provider/AuthProvider/index.electron.native.js +0 -281
  445. package/dist/jsx/provider/AuthProvider/index.electron.native.js.map +0 -6
  446. package/dist/jsx/provider/AuthProvider/index.js +0 -229
  447. package/dist/jsx/provider/AuthProvider/index.js.map +0 -6
  448. package/dist/jsx/provider/AuthProvider/index.mjs +0 -189
  449. package/dist/jsx/provider/AuthProvider/index.mjs.map +0 -1
  450. package/dist/jsx/provider/AuthProvider/index.native.js +0 -186
  451. package/dist/jsx/provider/AuthProvider/index.native.js.map +0 -6
  452. package/dist/jsx/provider/AuthProvider/index.webext.js +0 -231
  453. package/dist/jsx/provider/AuthProvider/index.webext.js.map +0 -6
  454. package/dist/jsx/provider/AuthProvider/index.webext.mjs +0 -189
  455. package/dist/jsx/provider/AuthProvider/index.webext.mjs.map +0 -1
  456. package/dist/jsx/provider/AuthProvider/index.webext.native.js +0 -281
  457. package/dist/jsx/provider/AuthProvider/index.webext.native.js.map +0 -6
  458. package/dist/jsx/provider/AuthProvider/shared.js +0 -14
  459. package/dist/jsx/provider/AuthProvider/shared.js.map +0 -6
  460. package/dist/jsx/provider/AuthProvider/shared.mjs +0 -11
  461. package/dist/jsx/provider/AuthProvider/shared.mjs.map +0 -1
  462. package/dist/jsx/provider/AuthProvider/shared.native.js +0 -17
  463. package/dist/jsx/provider/AuthProvider/shared.native.js.map +0 -6
  464. package/dist/jsx/provider/KeycloakProvider.js +0 -37
  465. package/dist/jsx/provider/KeycloakProvider.js.map +0 -6
  466. package/dist/jsx/provider/KeycloakProvider.mjs +0 -37
  467. package/dist/jsx/provider/KeycloakProvider.mjs.map +0 -1
  468. package/dist/jsx/provider/KeycloakProvider.native.js +0 -36
  469. package/dist/jsx/provider/KeycloakProvider.native.js.map +0 -6
  470. package/dist/jsx/provider/index.js +0 -4
  471. package/dist/jsx/provider/index.js.map +0 -6
  472. package/dist/jsx/provider/index.mjs +0 -4
  473. package/dist/jsx/provider/index.mjs.map +0 -1
  474. package/dist/jsx/provider/index.native.js +0 -4
  475. package/dist/jsx/provider/index.native.js.map +0 -6
  476. package/dist/jsx/session/index.electron.js +0 -11
  477. package/dist/jsx/session/index.electron.js.map +0 -6
  478. package/dist/jsx/session/index.electron.mjs +0 -8
  479. package/dist/jsx/session/index.electron.mjs.map +0 -1
  480. package/dist/jsx/session/index.electron.native.js +0 -11
  481. package/dist/jsx/session/index.electron.native.js.map +0 -6
  482. package/dist/jsx/session/index.js +0 -15
  483. package/dist/jsx/session/index.js.map +0 -6
  484. package/dist/jsx/session/index.mjs +0 -13
  485. package/dist/jsx/session/index.mjs.map +0 -1
  486. package/dist/jsx/session/index.native.js +0 -11
  487. package/dist/jsx/session/index.native.js.map +0 -6
  488. package/dist/jsx/session/index.webext.js +0 -11
  489. package/dist/jsx/session/index.webext.js.map +0 -6
  490. package/dist/jsx/session/index.webext.mjs +0 -8
  491. package/dist/jsx/session/index.webext.mjs.map +0 -1
  492. package/dist/jsx/session/index.webext.native.js +0 -11
  493. package/dist/jsx/session/index.webext.native.js.map +0 -6
  494. package/dist/jsx/state.js +0 -16
  495. package/dist/jsx/state.js.map +0 -6
  496. package/dist/jsx/state.mjs +0 -13
  497. package/dist/jsx/state.mjs.map +0 -1
  498. package/dist/jsx/state.native.js +0 -25
  499. package/dist/jsx/state.native.js.map +0 -6
  500. package/dist/jsx/token.js +0 -14
  501. package/dist/jsx/token.js.map +0 -6
  502. package/dist/jsx/token.mjs +0 -12
  503. package/dist/jsx/token.mjs.map +0 -1
  504. package/dist/jsx/token.native.js +0 -14
  505. package/dist/jsx/token.native.js.map +0 -6
  506. package/dist/jsx/types.js +0 -1
  507. package/dist/jsx/types.js.map +0 -6
  508. package/dist/jsx/types.mjs +0 -2
  509. package/dist/jsx/types.mjs.map +0 -1
  510. package/dist/jsx/types.native.js +0 -1
  511. package/dist/jsx/types.native.js.map +0 -6
  512. package/src/@types/expoKeycloakAuth.d.ts +0 -25
  513. package/src/keycloak/index.electron.ts +0 -72
  514. package/src/provider/AuthProvider/index.electron.tsx +0 -419
  515. package/src/provider/AuthProvider/index.native.tsx +0 -308
  516. package/src/session/index.electron.ts +0 -33
  517. package/types/Authenticated.d.ts +0 -29
  518. package/types/Authenticated.d.ts.map +0 -1
  519. package/types/Loading.d.ts +0 -26
  520. package/types/Loading.d.ts.map +0 -1
  521. package/types/authConfig.d.ts +0 -11
  522. package/types/authConfig.d.ts.map +0 -1
  523. package/types/hooks/index.d.ts +0 -24
  524. package/types/hooks/index.d.ts.map +0 -1
  525. package/types/hooks/useAuthConfig.d.ts +0 -2
  526. package/types/hooks/useAuthConfig.d.ts.map +0 -1
  527. package/types/hooks/useTokensFromQuery/index.d.ts +0 -2
  528. package/types/hooks/useTokensFromQuery/index.d.ts.map +0 -1
  529. package/types/hooks/useTokensFromQuery/index.native.d.ts +0 -2
  530. package/types/hooks/useTokensFromQuery/index.native.d.ts.map +0 -1
  531. package/types/hooks/useTokensFromState.d.ts +0 -2
  532. package/types/hooks/useTokensFromState.d.ts.map +0 -1
  533. package/types/index.d.ts +0 -28
  534. package/types/index.d.ts.map +0 -1
  535. package/types/keycloak/base.d.ts +0 -51
  536. package/types/keycloak/base.d.ts.map +0 -1
  537. package/types/keycloak/config.d.ts +0 -8
  538. package/types/keycloak/config.d.ts.map +0 -1
  539. package/types/keycloak/context.d.ts +0 -4
  540. package/types/keycloak/context.d.ts.map +0 -1
  541. package/types/keycloak/index.d.ts +0 -15
  542. package/types/keycloak/index.d.ts.map +0 -1
  543. package/types/keycloak/index.electron.d.ts +0 -12
  544. package/types/keycloak/index.electron.d.ts.map +0 -1
  545. package/types/keycloak/index.native.d.ts +0 -27
  546. package/types/keycloak/index.native.d.ts.map +0 -1
  547. package/types/keycloak/index.webext.d.ts +0 -12
  548. package/types/keycloak/index.webext.d.ts.map +0 -1
  549. package/types/one.d.ts +0 -27
  550. package/types/one.d.ts.map +0 -1
  551. package/types/provider/AfterAuth.d.ts +0 -26
  552. package/types/provider/AfterAuth.d.ts.map +0 -1
  553. package/types/provider/AuthProvider/index.d.ts +0 -23
  554. package/types/provider/AuthProvider/index.d.ts.map +0 -1
  555. package/types/provider/AuthProvider/index.electron.d.ts +0 -23
  556. package/types/provider/AuthProvider/index.electron.d.ts.map +0 -1
  557. package/types/provider/AuthProvider/index.native.d.ts +0 -23
  558. package/types/provider/AuthProvider/index.native.d.ts.map +0 -1
  559. package/types/provider/AuthProvider/index.webext.d.ts +0 -23
  560. package/types/provider/AuthProvider/index.webext.d.ts.map +0 -1
  561. package/types/provider/AuthProvider/shared.d.ts +0 -53
  562. package/types/provider/AuthProvider/shared.d.ts.map +0 -1
  563. package/types/provider/KeycloakProvider.d.ts +0 -30
  564. package/types/provider/KeycloakProvider.d.ts.map +0 -1
  565. package/types/provider/index.d.ts +0 -24
  566. package/types/provider/index.d.ts.map +0 -1
  567. package/types/session/index.d.ts +0 -16
  568. package/types/session/index.d.ts.map +0 -1
  569. package/types/session/index.electron.d.ts +0 -5
  570. package/types/session/index.electron.d.ts.map +0 -1
  571. package/types/session/index.native.d.ts +0 -5
  572. package/types/session/index.native.d.ts.map +0 -1
  573. package/types/session/index.webext.d.ts +0 -5
  574. package/types/session/index.webext.d.ts.map +0 -1
  575. package/types/state.d.ts +0 -9
  576. package/types/state.d.ts.map +0 -1
  577. package/types/token.d.ts +0 -16
  578. package/types/token.d.ts.map +0 -1
  579. package/types/types.d.ts +0 -19
  580. package/types/types.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,32 +1,7 @@
1
1
  {
2
2
  "name": "@multiplatform.one/keycloak",
3
- "version": "5.0.26",
3
+ "version": "6.0.0",
4
4
  "description": "keycloak client for multiplatform.one ecosystem",
5
- "main": "dist/cjs",
6
- "module": "dist/esm",
7
- "module:jsx": "dist/jsx",
8
- "source": "src/index.ts",
9
- "types": "types/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./types/index.d.ts",
13
- "import": "./dist/esm/index.js",
14
- "require": "./dist/cjs/index.js"
15
- },
16
- "./one": {
17
- "types": "./types/one.d.ts",
18
- "import": "./dist/esm/one.js",
19
- "require": "./dist/cjs/one.js"
20
- },
21
- "./emptyNextAuthReact": {
22
- "types": "./types/emptyNextAuthReact.d.ts",
23
- "import": "./dist/esm/emptyNextAuthReact.js",
24
- "require": "./dist/cjs/emptyNextAuthReact.js"
25
- },
26
- "./package.json": "./package.json"
27
- },
28
- "author": "BitSpur",
29
- "sideEffects": false,
30
5
  "keywords": [
31
6
  "auth",
32
7
  "keycloak",
@@ -36,52 +11,81 @@
36
11
  ],
37
12
  "homepage": "https://multiplatform.one",
38
13
  "license": "Apache-2.0",
14
+ "author": "BitSpur",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://gitlab.com/risserlabs/multiplatform.one/keycloak"
18
+ },
19
+ "source": "src/index.ts",
39
20
  "files": [
40
21
  "dist",
41
22
  "routes",
42
23
  "src",
43
24
  "types"
44
25
  ],
45
- "repository": {
46
- "type": "git",
47
- "url": "https://gitlab.com/risserlabs/multiplatform.one/keycloak"
26
+ "sideEffects": false,
27
+ "main": "src/index.ts",
28
+ "module": "src/index.ts",
29
+ "types": "src/index.ts",
30
+ "exports": {
31
+ "./package.json": "./package.json",
32
+ ".": {
33
+ "react-native": "./src/index.native.ts",
34
+ "types": "./src/index.ts",
35
+ "import": "./src/index.ts",
36
+ "require": "./src/index.ts",
37
+ "default": "./src/index.ts"
38
+ },
39
+ "./one": {
40
+ "types": "./src/one.ts",
41
+ "import": "./src/one.ts",
42
+ "require": "./src/one.ts"
43
+ }
48
44
  },
49
- "peerDependencies": {
50
- "@react-native-async-storage/async-storage": "1.21.0",
51
- "multiplatform.one": "5.0.26",
52
- "react": "~18.2.0"
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "dependencies": {
49
+ "@better-auth/expo": "^1.6.9",
50
+ "better-auth": "^1.6.9",
51
+ "jwt-decode": "^4.0.0",
52
+ "@multiplatform.one/keycloak-js": "6.0.0",
53
+ "@multiplatform.one/store": "6.0.0"
53
54
  },
54
55
  "devDependencies": {
55
- "@react-native-async-storage/async-storage": "1.23.1",
56
- "@tamagui/build": "^1.122.6",
57
- "@testing-library/jest-dom": "^6.6.3",
58
- "@testing-library/react": "^15.0.7",
56
+ "@tamagui/build": "2.0.0-rc.41",
57
+ "@testing-library/jest-dom": "^6.9.1",
58
+ "@testing-library/react": "^16.3.2",
59
59
  "@types/lodash.camelcase": "^4.3.9",
60
60
  "@types/lodash.startcase": "^4.4.9",
61
- "@types/react": "^18.3.1",
62
- "@types/react-native": "^0.73.0",
63
- "@vitejs/plugin-react": "^4.3.4",
64
- "multiplatform.one": "5.0.26",
65
- "react": "~18.2.0",
66
- "typescript": "~5.3.3",
67
- "vitest": "^1.6.0"
61
+ "@types/react": "~19.2.14",
62
+ "@vitejs/plugin-react": "^6.0.1",
63
+ "esbuild": "^0.28.0",
64
+ "one": "^1.16.5",
65
+ "react": "19.2.5",
66
+ "typescript": "~5.9.3",
67
+ "vitest": "^4.1.5",
68
+ "@multiplatform.one/config": "6.0.0",
69
+ "@multiplatform.one/logger": "6.0.0",
70
+ "@multiplatform.one/platform": "6.0.0",
71
+ "@multiplatform.one/test-utils": "6.0.0"
72
+ },
73
+ "peerDependencies": {
74
+ "react": "^19.1.0",
75
+ "@multiplatform.one/logger": "6.0.0",
76
+ "@multiplatform.one/platform": "6.0.0"
77
+ },
78
+ "optionalDependencies": {
79
+ "expo-secure-store": "^55.0.13",
80
+ "expo-web-browser": "^55.0.14"
68
81
  },
69
82
  "engines": {
70
83
  "node": ">=6.0.0"
71
84
  },
72
- "dependencies": {
73
- "@auth/core": "^0.36.0",
74
- "@multiplatform.one/authjs": "5.0.26",
75
- "@multiplatform.one/use-store": "5.0.26",
76
- "expo-auth-session": "^5.5.2",
77
- "expo-crypto": "^13.0.2",
78
- "jwt-decode": "^4.0.0",
79
- "keycloak-js": "^24.0.5",
80
- "next-auth": "^4.24.11"
81
- },
85
+ "module:jsx": "dist/jsx",
82
86
  "scripts": {
83
87
  "typecheck": "tsc --noEmit",
84
- "build": "rm -rf dist types 2>/dev/null && tamagui-build --ts-project ./tsconfig.build.json",
88
+ "build": "rm -rf dist types 2>/dev/null && node scripts/build.mjs",
85
89
  "test": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=text --coverage.reporter=lcov --coverage.reporter=html"
86
90
  }
87
91
  }
@@ -0,0 +1,4 @@
1
+ declare module "expo-keycloak-auth" {
2
+ export const KeycloakProvider: any;
3
+ export function useKeycloak(): any;
4
+ }
@@ -1,33 +1,9 @@
1
- /**
2
- * File: /src/Authenticated.tsx
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 19-11-2024 20:26:31
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
- import AsyncStorage from "@react-native-async-storage/async-storage";
23
- import { isIframe, isServer } from "multiplatform.one";
1
+ import { isIframe, isServer } from "@multiplatform.one/platform";
24
2
  import { type ComponentType, type PropsWithChildren, useEffect } from "react";
25
3
  import { Text } from "tamagui";
26
4
  import { useAuthConfig, useTokensFromQuery } from "./hooks";
27
5
  import { useKeycloak } from "./keycloak/index";
28
6
 
29
- global.AsyncStorage = AsyncStorage;
30
-
31
7
  export interface AuthenticatedProps extends PropsWithChildren {
32
8
  disabled?: boolean;
33
9
  loadingComponent?: ComponentType;
package/src/Loading.tsx CHANGED
@@ -1,24 +1,3 @@
1
- /**
2
- * File: /src/Loading.tsx
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 01-01-1970 00:00:00
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
1
  import type { ComponentType } from "react";
23
2
  import { Text } from "tamagui";
24
3
  import { useAuthConfig } from "./hooks";
package/src/authConfig.ts CHANGED
@@ -1,24 +1,3 @@
1
- /*
2
- * File: /src/authConfig.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 04-04-2024 15:50:39
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
1
  import { createContext } from "react";
23
2
 
24
3
  export const defaultAuthConfig: AuthConfig = {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Better Auth React client instance for web.
3
+ * Used by AuthProvider and useKeycloak on web platform.
4
+ * Base URL is set at runtime via KeycloakProvider props (or defaults to same origin).
5
+ */
6
+
7
+ import { createAuthClient } from "better-auth/react";
8
+ import { genericOAuthClient } from "better-auth/client/plugins";
9
+ import { isWeb } from "@multiplatform.one/platform";
10
+
11
+ let _client: ReturnType<typeof createAuthClient> | undefined;
12
+
13
+ export function getAuthClient(baseURL?: string) {
14
+ if (_client) return _client;
15
+ _client = createAuthClient({
16
+ baseURL: baseURL || (isWeb && typeof window !== "undefined" ? window.location.origin : ""),
17
+ plugins: [genericOAuthClient()],
18
+ });
19
+ return _client;
20
+ }
21
+
22
+ export type AuthClient = ReturnType<typeof getAuthClient>;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Better Auth Expo client for native (React Native / Expo).
3
+ * Uses @better-auth/expo/client (expoClient plugin) and SecureStore.
4
+ * Wraps signIn.social for Keycloak; same session/useSession API.
5
+ */
6
+
7
+ import { createAuthClient } from "better-auth/react";
8
+ import { genericOAuthClient } from "better-auth/client/plugins";
9
+ import { expoClient } from "@better-auth/expo/client";
10
+ import * as SecureStore from "expo-secure-store";
11
+
12
+ let _client: ReturnType<typeof createAuthClient> | undefined;
13
+
14
+ /**
15
+ * Create or return the singleton Better Auth Expo client.
16
+ * @param baseURL — Better Auth server base URL (e.g. https://app.example.com)
17
+ * @param scheme — Expo deep link scheme (from app.json, e.g. "one" or "myapp")
18
+ */
19
+ export function getExpoAuthClient(baseURL: string, scheme = "one") {
20
+ if (_client) return _client;
21
+ _client = createAuthClient({
22
+ baseURL,
23
+ plugins: [
24
+ genericOAuthClient(),
25
+ expoClient({
26
+ scheme,
27
+ storagePrefix: "better-auth",
28
+ storage: SecureStore,
29
+ }),
30
+ ],
31
+ });
32
+ return _client;
33
+ }
34
+
35
+ export type ExpoAuthClient = ReturnType<typeof getExpoAuthClient>;
@@ -0,0 +1,2 @@
1
+ export { getAuthClient, type AuthClient } from "./client";
2
+ export { getExpoAuthClient, type ExpoAuthClient } from "./expoClient";
@@ -1,24 +1,3 @@
1
- /**
2
- * File: /src/hooks/index.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 19-11-2024 20:26:31
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
1
  export * from "./useAuthConfig";
23
2
  export * from "./useTokensFromQuery/index";
24
3
  export * from "./useTokensFromState";
@@ -1,24 +1,3 @@
1
- /*
2
- * File: /src/hooks/useAuthConfig.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 04-04-2024 15:50:39
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
1
  import { useContext } from "react";
23
2
  import { AuthConfigContext } from "../authConfig";
24
3
 
@@ -1,22 +1 @@
1
- /*
2
- * File: /src/hooks/useTokensFromQuery/index.native.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 04-04-2024 15:50:39
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
1
  export const useTokensFromQuery = () => false;
@@ -1,25 +1,4 @@
1
- /*
2
- * File: /src/hooks/useTokensFromQuery/index.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 19-11-2024 20:26:31
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
- import { isIframe } from "multiplatform.one";
1
+ import { isIframe } from "@multiplatform.one/platform";
23
2
  import { useAuthConfig } from "../useAuthConfig";
24
3
 
25
4
  export function useTokensFromQuery() {
@@ -1,29 +1,7 @@
1
- /*
2
- * File: /src/hooks/useTokensFromState.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 04-04-2024 15:50:39
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
1
  import { useAuthStore } from "../state";
23
2
  import { validOrRefreshableToken } from "../token";
24
3
 
25
4
  export function useTokensFromStore() {
26
5
  const authStore = useAuthStore();
27
- if (typeof authStore === "undefined") return undefined;
28
6
  return !!validOrRefreshableToken(authStore.token, authStore.refreshToken);
29
7
  }
package/src/index.ts CHANGED
@@ -1,49 +1,8 @@
1
- /*
2
- * File: /src/index.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 10-01-2025 21:02:36
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2025
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
- /**
23
- * File: /src/index.ts
24
- * Project: @multiplatform.one/keycloak
25
- * File Created: 19-11-2024 20:26:31
26
- * Author: Clay Risser
27
- * -----
28
- * BitSpur (c) Copyright 2021 - 2024
29
- *
30
- * Licensed under the Apache License, Version 2.0 (the "License");
31
- * you may not use this file except in compliance with the License.
32
- * You may obtain a copy of the License at
33
- *
34
- * http://www.apache.org/licenses/LICENSE-2.0
35
- *
36
- * Unless required by applicable law or agreed to in writing, software
37
- * distributed under the License is distributed on an "AS IS" BASIS,
38
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
- * See the License for the specific language governing permissions and
40
- * limitations under the License.
41
- */
42
-
43
1
  export * from "./Authenticated";
44
2
  export * from "./authConfig";
45
3
  export * from "./hooks/index";
46
4
  export * from "./keycloak/index";
47
5
  export * from "./provider/index";
48
6
  export * from "./session/index";
7
+ export * from "./token";
49
8
  export * from "./types";
@@ -1,31 +1,9 @@
1
- /*
2
- * File: /src/keycloak/base.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 25-12-2024 04:55:48
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
- import type { AuthRequestPromptOptions } from "expo-auth-session";
23
1
  import { jwtDecode } from "jwt-decode";
24
- import type KeycloakClient from "keycloak-js";
2
+ import type KeycloakClient from "@multiplatform.one/keycloak-js";
25
3
  import type {
26
4
  KeycloakLoginOptions as KeycloakJsLoginOptions,
27
5
  KeycloakLogoutOptions as KeycloakJsLogoutOptions,
28
- } from "keycloak-js";
6
+ } from "@multiplatform.one/keycloak-js";
29
7
  import { useContext } from "react";
30
8
  import { useAuthConfig } from "../hooks/index";
31
9
  import type { Session } from "../session/index";
@@ -199,8 +177,7 @@ export function useKeycloak() {
199
177
  }
200
178
 
201
179
  export type KeycloakLogoutOptions = KeycloakJsLogoutOptions;
202
- export type KeycloakLoginOptions = KeycloakJsLoginOptions &
203
- AuthRequestPromptOptions & { redirect?: boolean };
180
+ export type KeycloakLoginOptions = KeycloakJsLoginOptions & { redirect?: boolean };
204
181
 
205
182
  export interface ResourceAccess {
206
183
  [clientId: string]: {
@@ -1,30 +1,14 @@
1
- /*
2
- * File: /src/keycloak/config.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 27-04-2024 10:53:19
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
- import type { KeycloakConfig as KeycloakJsConfig } from "keycloak-js";
1
+ import type { KeycloakServerConfig } from "@multiplatform.one/keycloak-js";
23
2
  import { createContext } from "react";
24
3
 
25
- export interface KeycloakConfig extends KeycloakJsConfig {
4
+ /** App config uses the Keycloak-server shape ({ url, realm, clientId }), not generic OIDC. */
5
+ export interface KeycloakConfig extends KeycloakServerConfig {
26
6
  publicClientId?: string;
27
7
  scopes?: string[];
8
+ /** Better Auth server base URL (for native/Expo). Defaults to same origin on web. */
9
+ betterAuthBaseUrl?: string;
10
+ /** Expo deep-link scheme (e.g. "multiplatform-one"). Used by @better-auth/expo client. */
11
+ expoScheme?: string;
28
12
  }
29
13
 
30
14
  export const KeycloakConfigContext = createContext<KeycloakConfig>({
@@ -1,24 +1,3 @@
1
- /*
2
- * File: /src/keycloak/context.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 04-04-2024 15:50:39
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
1
  import { createContext } from "react";
23
2
  import type { Keycloak } from ".";
24
3
 
@@ -1,25 +1,4 @@
1
- /**
2
- * File: /src/keycloak/index.native.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 19-11-2024 20:26:31
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
- import { isStorybook } from "multiplatform.one";
1
+ import { isStorybook } from "@multiplatform.one/platform";
23
2
  import { useContext } from "react";
24
3
  import { useAuthConfig } from "../hooks";
25
4
  import { BaseKeycloak } from "./base";