diff --git a/package.json b/package.json
index 3499140..9307ee3 100644
--- a/package.json
+++ b/package.json
@@ -56,6 +56,7 @@
"rrule": "^2.8.1",
"supabase": "^1.192.5",
"web-push": "^3.6.7",
+ "wibu-realtime": "bipproduction/wibu-realtime",
"yargs": "^17.7.2"
},
"devDependencies": {
diff --git a/src/app/test/_ui/RealtimePage.tsx b/src/app/test/_ui/RealtimePage.tsx
new file mode 100644
index 0000000..d962bf3
--- /dev/null
+++ b/src/app/test/_ui/RealtimePage.tsx
@@ -0,0 +1,27 @@
+'use client'
+import { Button, Stack } from '@mantine/core'
+import { useShallowEffect } from '@mantine/hooks'
+import { useWibuRealtime } from 'wibu-realtime'
+export function RealtimePage({ wibuKey }: { wibuKey: string }) {
+ const [data, setData] = useWibuRealtime({
+ WIBU_REALTIME_TOKEN: wibuKey,
+ project: "sdm"
+ })
+ useShallowEffect(() => {
+ if (data) {
+ console.log(data)
+ }
+ }, [data])
+
+ async function onTekan() {
+ setData({
+ name: Math.random().toString(),
+ })
+ }
+ return (
+
+ {JSON.stringify(data)}
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/app/test/page.tsx b/src/app/test/page.tsx
new file mode 100644
index 0000000..859070f
--- /dev/null
+++ b/src/app/test/page.tsx
@@ -0,0 +1,11 @@
+import { Stack } from "@mantine/core";
+import { RealtimePage } from "./_ui/RealtimePage";
+const WIBU_REALTIME_KEY = process.env.WIBU_REALTIME_KEY!
+
+export default function Page() {
+ return (
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 9cdd281..9aee8f8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -432,6 +432,63 @@
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.10.3.tgz#391d528054f758f81e53210f1a1eebcf1a8b1d20"
integrity sha512-qC/xYId4NMebE6w/V33Fh9gWxLgURiNYgVNObbJl2LZv0GUUItCcCqC5axQSwRaAgaxl2mELq1rMzlswaQ0Zxg==
+"@supabase/auth-js@2.65.0":
+ version "2.65.0"
+ resolved "https://registry.yarnpkg.com/@supabase/auth-js/-/auth-js-2.65.0.tgz#e345c492f8cbc31cd6289968eae0e349ff0f39e9"
+ integrity sha512-+wboHfZufAE2Y612OsKeVP4rVOeGZzzMLD/Ac3HrTQkkY4qXNjI6Af9gtmxwccE5nFvTiF114FEbIQ1hRq5uUw==
+ dependencies:
+ "@supabase/node-fetch" "^2.6.14"
+
+"@supabase/functions-js@2.4.1":
+ version "2.4.1"
+ resolved "https://registry.yarnpkg.com/@supabase/functions-js/-/functions-js-2.4.1.tgz#373e75f8d3453bacd71fb64f88d7a341d7b53ad7"
+ integrity sha512-8sZ2ibwHlf+WkHDUZJUXqqmPvWQ3UHN0W30behOJngVh/qHHekhJLCFbh0AjkE9/FqqXtf9eoVvmYgfCLk5tNA==
+ dependencies:
+ "@supabase/node-fetch" "^2.6.14"
+
+"@supabase/node-fetch@2.6.15", "@supabase/node-fetch@^2.6.14":
+ version "2.6.15"
+ resolved "https://registry.yarnpkg.com/@supabase/node-fetch/-/node-fetch-2.6.15.tgz#731271430e276983191930816303c44159e7226c"
+ integrity sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==
+ dependencies:
+ whatwg-url "^5.0.0"
+
+"@supabase/postgrest-js@1.16.1":
+ version "1.16.1"
+ resolved "https://registry.yarnpkg.com/@supabase/postgrest-js/-/postgrest-js-1.16.1.tgz#68dfa0581d8ae4296378cb8815bbde3f4602aef5"
+ integrity sha512-EOSEZFm5pPuCPGCmLF1VOCS78DfkSz600PBuvBND/IZmMciJ1pmsS3ss6TkB6UkuvTybYiBh7gKOYyxoEO3USA==
+ dependencies:
+ "@supabase/node-fetch" "^2.6.14"
+
+"@supabase/realtime-js@2.10.2":
+ version "2.10.2"
+ resolved "https://registry.yarnpkg.com/@supabase/realtime-js/-/realtime-js-2.10.2.tgz#c2b42d17d723d2d2a9146cfad61dc3df1ce3127e"
+ integrity sha512-qyCQaNg90HmJstsvr2aJNxK2zgoKh9ZZA8oqb7UT2LCh3mj9zpa3Iwu167AuyNxsxrUE8eEJ2yH6wLCij4EApA==
+ dependencies:
+ "@supabase/node-fetch" "^2.6.14"
+ "@types/phoenix" "^1.5.4"
+ "@types/ws" "^8.5.10"
+ ws "^8.14.2"
+
+"@supabase/storage-js@2.7.0":
+ version "2.7.0"
+ resolved "https://registry.yarnpkg.com/@supabase/storage-js/-/storage-js-2.7.0.tgz#9ff322d2c3b141087aa34115cf14205e4980ce75"
+ integrity sha512-iZenEdO6Mx9iTR6T7wC7sk6KKsoDPLq8rdu5VRy7+JiT1i8fnqfcOr6mfF2Eaqky9VQzhP8zZKQYjzozB65Rig==
+ dependencies:
+ "@supabase/node-fetch" "^2.6.14"
+
+"@supabase/supabase-js@^2.45.4":
+ version "2.45.4"
+ resolved "https://registry.yarnpkg.com/@supabase/supabase-js/-/supabase-js-2.45.4.tgz#0bcf8722f1732dfe3e4c5190d23e3938dcc689c3"
+ integrity sha512-E5p8/zOLaQ3a462MZnmnz03CrduA5ySH9hZyL03Y+QZLIOO4/Gs8Rdy4ZCKDHsN7x0xdanVEWWFN3pJFQr9/hg==
+ dependencies:
+ "@supabase/auth-js" "2.65.0"
+ "@supabase/functions-js" "2.4.1"
+ "@supabase/node-fetch" "2.6.15"
+ "@supabase/postgrest-js" "1.16.1"
+ "@supabase/realtime-js" "2.10.2"
+ "@supabase/storage-js" "2.7.0"
+
"@swc/counter@^0.1.3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9"
@@ -701,6 +758,11 @@
dependencies:
undici-types "~5.26.4"
+"@types/phoenix@^1.5.4":
+ version "1.6.5"
+ resolved "https://registry.yarnpkg.com/@types/phoenix/-/phoenix-1.6.5.tgz#5654e14ec7ad25334a157a20015996b6d7d2075e"
+ integrity sha512-xegpDuR+z0UqG9fwHqNoy3rI7JDlvaPh2TY47Fl80oq6g+hXT+c/LEuE43X48clZ6lOfANl5WrPur9fYO1RJ/w==
+
"@types/prop-types@*":
version "15.7.12"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6"
@@ -736,7 +798,7 @@
dependencies:
"@types/node" "*"
-"@types/ws@^8.5.9":
+"@types/ws@^8.5.10", "@types/ws@^8.5.9":
version "8.5.12"
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.12.tgz#619475fe98f35ccca2a2f6c137702d85ec247b7e"
integrity sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==
@@ -3423,7 +3485,7 @@ queue-microtask@^1.2.2:
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
-react-dom@^18:
+react-dom@^18, react-dom@^18.3.1:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
@@ -3518,7 +3580,7 @@ react-transition-group@4.4.5, react-transition-group@^4.4.5:
loose-envify "^1.4.0"
prop-types "^15.6.2"
-react@^18:
+react@^18, react@^18.3.1:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
@@ -4410,6 +4472,15 @@ which@^2.0.1:
dependencies:
isexe "^2.0.0"
+wibu-realtime@bipproduction/wibu-realtime:
+ version "0.0.2"
+ resolved "https://codeload.github.com/bipproduction/wibu-realtime/tar.gz/869adc04670602b4fccb833e7732d72b2061ee15"
+ dependencies:
+ "@supabase/supabase-js" "^2.45.4"
+ jose "^5.9.2"
+ react "^18.3.1"
+ react-dom "^18.3.1"
+
wide-align@^1.1.2:
version "1.1.5"
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3"
@@ -4482,7 +4553,7 @@ write-file-atomic@^5.0.0:
imurmurhash "^0.1.4"
signal-exit "^4.0.1"
-ws@^8.17.1:
+ws@^8.14.2, ws@^8.17.1:
version "8.18.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc"
integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==