website/src/content/docs/actors/quickstart/backend.mdx
import { Hosting } from "@/components/docs/Hosting"; import { ConfigurationOptions } from "@/components/docs/ConfigurationOptions";
<Note> Prefer to start from a complete project? See the runnable [`hello-world`](https://github.com/rivet-dev/rivet/tree/main/examples/hello-world) example. </Note>If you're using an AI coding assistant (like Claude Code, Cursor, Windsurf, etc.), add Rivet skills for enhanced development assistance:
npx skills add rivet-dev/skills
npm install rivetkit
Create a file with your actors, set up the registry, and start the server:
<CodeSnippet file="examples/docs/actors-quickstart-backend/index.ts" title="index.ts" /> </Step> <Step title="Run Server"> <CodeGroup>npx tsx --watch index.ts
bun --watch index.ts
deno run --allow-net --allow-read --allow-env --watch index.ts
Your server is now running on http://localhost:6420. Clients connect directly to the Rivet Engine on this port.
Visit http://localhost:6420 in your browser (or point your AI agent at it) to open the Rivet developer tools and inspect your actors live.
</Step> <Step title="Connect To The Rivet Actor">This code can run either in your frontend or within your backend:
<Tabs> <Tab title="TypeScript"> <CodeGroup> <CodeSnippet file="examples/docs/actors-quickstart-backend/client.ts" title="client.ts" /> </CodeGroup>See the JavaScript client documentation for more information.
</Tab> <Tab title="React"> <CodeGroup> <CodeSnippet file="examples/docs/actors-quickstart-backend/Counter.tsx" title="Counter.tsx" /> </CodeGroup>See the React documentation for more information.
</Tab> </Tabs> </Step> <Step title="Deploy"> <Hosting /> </Step> </Steps>