Core low-level types for working with the Rivet Actor runtime.
This package is for advanced low-level usage of Rivet. If getting started, please use the Actor SDK.
import { Hono } from "hono"; import { upgradeWebSocket } from "hono/deno"; import { assertExists } from "@std/assert"; // Start server export default { async start(ctx) { // Start basic HTTP server const app = new Hono(); app.get("/kv-test", (c) => { // Access the KV API await ctx.kv.put("foo", "bar"); return c.text("done"); }); // Find port const portEnv = Deno.env.get("PORT_HTTP"); assertExists(portEnv, "missing PORT_HTTP"); const port = Number.parseInt(portEnv); // Start server console.log(`Listening on port ${port}`); const server = Deno.serve({ port }, app.fetch); await server.finished; }, };
Apache 2.0
Add Package
deno add jsr:@rivet-gg/actor-core
Import symbol
import * as actor_core from "@rivet-gg/actor-core";
---- OR ----
Import directly with a jsr specifier
import * as actor_core from "jsr:@rivet-gg/actor-core";