Skip to main content
This release is a pre-release — the latest non-prerelease version of @rivet-gg/actor-core is 24.6.1. Jump to this version

⚫ Core low-level types for working with the Rivet Actor runtime.

This package works with Deno
This package works with Deno
JSR Score
64%
Published
2 days ago (24.6.2-rc.2)

Rivet Actor Core

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.

Getting Started

Example

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;
	},
};

Community & Support

License

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";