This repository was archived by the owner on Oct 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 18 files changed +59
-63
lines changed
better-auth-external-db/src/frontend/components
raw-websocket-handler/src/frontend Expand file tree Collapse file tree 18 files changed +59
-63
lines changed Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useEffect , useState } from "react" ;
33import type { Message , registry } from "../backend/registry" ;
44
5- const client = createClient < typeof registry > ( "http://localhost:8080" ) ;
6- const { useActor } = createRivetKit ( client ) ;
5+ const { useActor } = createRivetKit < typeof registry > ( "http://localhost:8080" ) ;
76
87export function App ( ) {
98 const aiAgent = useActor ( {
@@ -77,4 +76,4 @@ export function App() {
7776 </ div >
7877 </ div >
7978 ) ;
80- }
79+ }
Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useEffect , useState } from "react" ;
33import type { registry } from "../../backend/registry" ;
44import { authClient } from "../auth-client" ;
55
6- const client = createClient < typeof registry > ( "http://localhost:8080" ) ;
7-
8- const { useActor } = createRivetKit ( client ) ;
6+ const { useActor } = createRivetKit < typeof registry > ( "http://localhost:8080" ) ;
97
108interface ChatRoomProps {
119 user : { id : string ; email : string } ;
Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useEffect , useState } from "react" ;
33import type { Message , registry } from "../backend/registry" ;
44
5- const client = createClient < typeof registry > ( "http://localhost:6420" ) ;
6- const { useActor } = createRivetKit ( client ) ;
5+ const { useActor } = createRivetKit < typeof registry > ( "http://localhost:6420" ) ;
76
87export function App ( ) {
98 const [ roomId , setRoomId ] = useState ( "general" ) ;
Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useEffect , useRef , useState } from "react" ;
33import * as Y from "yjs" ;
44import { applyUpdate , encodeStateAsUpdate } from "yjs" ;
55import type { registry } from "../backend/registry" ;
66
7- const client = createClient < typeof registry > ( "http://localhost:8080" ) ;
8- const { useActor } = createRivetKit ( client ) ;
7+ const { useActor } = createRivetKit < typeof registry > ( "http://localhost:8080" ) ;
98
109function YjsEditor ( { documentId } : { documentId : string } ) {
1110 const yjsDocument = useActor ( {
@@ -192,4 +191,4 @@ function bufferToBase64(buffer: Uint8Array): string {
192191 binary += String . fromCharCode ( buffer [ i ] ) ;
193192 }
194193 return btoa ( binary ) ;
195- }
194+ }
Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useEffect , useState } from "react" ;
33import type { Note , registry } from "../backend/registry" ;
44
5- const client = createClient < typeof registry > ( "http://localhost:8080" ) ;
6- const { useActor } = createRivetKit ( client ) ;
5+ const { useActor } = createRivetKit < typeof registry > ( "http://localhost:8080" ) ;
76
87function NotesApp ( { userId } : { userId : string } ) {
98 const [ notes , setNotes ] = useState < Note [ ] > ( [ ] ) ;
@@ -199,4 +198,4 @@ export function App() {
199198 < NotesApp key = { selectedUser } userId = { selectedUser } />
200199 </ div >
201200 ) ;
202- }
201+ }
Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useEffect , useState } from "react" ;
33import type { Message , registry } from "../backend/registry" ;
44
5- const client = createClient < typeof registry > ( {
5+ const { useActor } = createRivetKit < typeof registry > ( {
66 endpoint : import . meta. env . VITE_RIVET_ENDPOINT ?? "http://localhost:8080/api" ,
77 namespace : import . meta. env . VITE_RIVET_NAMESPACE ,
88 runnerName : import . meta. env . VITE_RIVET_RUNNER_NAME ?? "freestyle-runner" ,
99} ) ;
10- const { useActor } = createRivetKit ( client ) ;
1110
1211export function App ( ) {
1312 const [ roomId , setRoomId ] = useState ( "general" ) ;
Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useEffect , useRef , useState } from "react" ;
33import type { Player , registry } from "../backend/registry" ;
44
5- const client = createClient < typeof registry > ( "http://localhost:8080" ) ;
6- const { useActor } = createRivetKit ( client ) ;
5+ const { useActor } = createRivetKit < typeof registry > ( "http://localhost:8080" ) ;
76
87export function App ( ) {
98 const [ players , setPlayers ] = useState < Player [ ] > ( [ ] ) ;
@@ -200,4 +199,4 @@ export function App() {
200199 </ div >
201200 </ div >
202201 ) ;
203- }
202+ }
Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useState } from "react" ;
33import type { registry } from "../backend/registry" ;
44
5- const client = createClient < typeof registry > ( "http://localhost:8080/rivet" ) ;
6- const { useActor } = createRivetKit < typeof registry > ( client ) ;
5+ const { useActor } = createRivetKit < typeof registry > ( "http://localhost:8080/rivet" ) ;
76
87function App ( ) {
98 const [ count , setCount ] = useState ( 0 ) ;
Original file line number Diff line number Diff line change 1- import { createClient , createRivetKit } from "@rivetkit/react" ;
1+ import { createRivetKit } from "@rivetkit/react" ;
22import { useState } from "react" ;
33import type { registry } from "../backend/registry" ;
44
5- const client = createClient < typeof registry > ( "http://localhost:8080" ) ;
6- const { useActor } = createRivetKit < typeof registry > ( client ) ;
5+ const { useActor } = createRivetKit < typeof registry > ( "http://localhost:8080" ) ;
76
87function App ( ) {
98 const [ count , setCount ] = useState ( 0 ) ;
Original file line number Diff line number Diff line change 11"use client" ;
2+
3+ import { createRivetKit } from "@rivetkit/next-js/client" ;
4+ import type { registry } from "@/rivet/registry" ;
25import { useState } from "react" ;
3- import { useActor } from "@/lib/rivet-client" ;
46import styles from "./Counter.module.css" ;
57
8+ export const { useActor } = createRivetKit < typeof registry > (
9+ process . env . NEXT_RIVET_ENDPOINT ?? "http://localhost:3000/api/rivet" ,
10+ ) ;
11+
612export function Counter ( ) {
713 const [ count , setCount ] = useState ( 0 ) ;
814 const [ counterName , setCounterName ] = useState ( "test-counter" ) ;
You can’t perform that action at this time.
0 commit comments