Rivet Developer Network

RDN

Rivet Developer Network

Build and scale stateful workloads. Rivet is a library for long-lived processes with durable state, realtime, and scalability. Easily self-hostable and works with your infrastructure.

Join

Confused about bun / hono implementation

hey, its been about a month since ive messed around. seems like theres been alot of big updates. right now, my old implementation w/ hono + bun doesnt seem to be working `//routes/rivet-registry.ts...

Error with "getOrCreate"

Getting the following when trying to call "getOrCreate" from my client. This happens both when trying to access via "useActor" hook and manually calling the method. When i create the actor in the studio and then call getForId then the client resolves to the right actor and I can call actions successfully...

onAuth not in rivetkit yet?

On the rivet.dev site, I see a bunch of references to onAuth. But after installing rivetkit 2.0.7 and getting errors about that not being found in the types, I went and searched the github on master. I don't see it anywhere in there (other than documentation) either: https://github.com/search?q=repo%3Arivet-dev%2Frivetkit+onAuth&type=code Do I have some crazy fundamental misunderstanding of where onAuth is to actually use it?...

cbor error with 2.0.7 and createWithInput

I'm using rivetkit 2.0.7 and typescript client but when I use: ``` client.....getOrCreate([i], { params: {...

What is the RIVETKIT_INSPECTOR_TOKEN

What is the RIVETKIT_INSPECTOR_TOKEN and where can i get the value

Invalid Protocol Version

Hey guys, I followed docs and made a counter actor, it works fine without a RIVET_ENGINE url but after I add one (using docker compose from self hosting documentation) it doesn't work anymore. ```ts...

Setting alarm and onStateChange

Hello, I'm using onStateChange to propagate state to firestore DB. And it seems to me that onStateChange is called even when there is no actual state changed for example I can see following logs: Writing to Firestore: http://127.0.0.1:8081/v1/projects/teamday-ai/databases/(default)/documents/aiChatV2/0UwNVUblr3HvhkD8SjaX level=INFO msg="scheduling event" ccl=true t=1757490470340 Writing to Firestore: http://127.0.0.1:8081/v1/projects/teamday-ai/databases/(default)/documents/aiChatV2/0UwNVUblr3HvhkD8SjaX...

Sqlite

@Nathan kudos on the V2 release . what is the status of sqlite with v2 out now (putting the examples back in didnt make the cut with this release) .

Errors after the registry server is restarted

First of all, this is amazing project, thank you guys! My steps: 1. Started the rivet-engine via docker-compose 2. Started registry server (as in express example, nothing more) 3. Send post request via curl (as in example)...
No description

few suggestions / ideas

hello, we just upgraded from actor core(0.8) to rivetkit (0.9.9). Everything went smoothly really nice upgrade. Great job with lib 🙂 I have few things I noticed during upgrade:...

What causes this warning?

I'm wondering what causes this warning as it heavily pollutes my logs this is the code listening to the event, only in the root component. send is a function to update my local store ```ts...
No description

How to Make an Actor Action Private and Restrict Client Invocation

I created an actor with an action called generateContent. I want to make this action private so that only the registry server can invoke it, and no clients can call this action directly. However, I still want clients to be able to subscribe to this actor without having permission to invoke the generateContent action. Currently, I am using a simple apiKey approach to restrict access, but I am looking for a better or more secure way to achieve this. For reference, here is the relevant code snippet: ...

Problem connecting to actor from front end using cloudflare worker with hono

I'm not sure if how I'm setting it up wrong, but the code for cloudflare driver seems to skip setting the registry route if you pass a hono instance as an option. https://github.com/rivet-gg/rivetkit/blob/main/packages/drivers/cloudflare-workers/src/handler.ts ```ts...

missing ws for sendMessage

How to prevent this warning? ```plaintext level=WARN msg="websocket closed" code=1001 reason="" wasClean=false level=INFO msg="removing websocket for conn" totalCount=1...

Extracting ActorConn type

```ts export class Actor { conn: unknown | null = null; init(userID: string, queryClient: QueryClient) {...

0.9.9 release lifecycle types

Hey just upgraded to 0.9.9 a few minutes ago, OnCreateOptions & CreateStateOptionstypes seem to be missing from the actors pkg exports. ...

Tying resources like DB connection to actor lifecycle

How might you recommend tying a resource like a DB connection to the actor lifecycle? The below is what I was thinking, but there are a couple of issues with the approach: 1. db conn not available in createState. not critical, but would be nice to be able to lookup and initialize some state based on the input or actor key 2. not sure how to cleanup the connection. in cloudflare's example they are tying the connection to each request's lifecycle, and using ctx.waitUntil (https://developers.cloudflare.com/workers/databases/third-party-integrations/planetscale/#3-use-hyperdrive-from-your-worker), but that doesn't quite map 1-1 w actor lifecycle. There isn't a way to hook into actor destruction/cleanup is there? Might not be possible - haven't looked deep but I'm not sure if there is even a way with raw CF durable objects ...

missing CF_AMBIENT_ENV

Any idea what might cause this? Just trying Rivet out for the first time, with cloudflare. - rivet actor and worker version: 0.9.8 - @cloudflare/vite-plugin: 1.11.2 - wranger: 4.28.1...

Hono & Nextjs

getting type error: Property '#private' in type 'Registry' refers to a different member that cannot be accessed from within type 'Registry'. versions: ``` "@rivetkit/actor": "^0.9.8",...

Bun/Hono & Next.js Issues

I copied the counter actor quickstart from the bun / hono getting started. and then used the react package on my nextjs project to test it out. ran into a variety of issues. 1. originally used cors({ origin: "*" }) but kept getting cors errors on my nextjs console. The only resolution was this:...