-
Notifications
You must be signed in to change notification settings - Fork 135
docs: simplify setup guide and modernize SDK instructions #2004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
NathanFlurry
wants to merge
1
commit into
02-07-fix_cli_auto-generate_.yarnrc.yml_to_disable_pnp_for_tsx_support
from
docs_simplify_setup_guide_and_modernize_SDK_instructions
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,22 +3,18 @@ import imgActors from "./images/setup/actors.png"; | |
|
|
||
| # Initial Setup | ||
|
|
||
| This guide will walk you through: | ||
| This guide will walk you through initializing your project, deploying an actor, and setting up your client SDK. | ||
|
|
||
| 1. Initializing a new project | ||
| 2. Deploying a Rivet Actor | ||
| 3. Setting up the Rivet client SDK | ||
|
|
||
| If you get stuck at any point, you can read the [troubleshooting guide](/docs/troubleshooting), ask a | ||
| If you get stuck at any point, you can ask a | ||
| question on [Discord](https://rivet.gg/discord)/[GitHub | ||
| Discussion](https://github.com/orgs/rivet-gg/discussions), or file a bug report on [GitHub | ||
| Discussion](https://github.com/orgs/rivet-gg/discussions) or file a bug report on [GitHub | ||
| Issues](https://github.com/rivet-gg/rivet/issues). | ||
|
|
||
| <Steps> | ||
|
|
||
| <Step title="Install CLI"> | ||
|
|
||
| The easiest way to get start with Rivet is to use the CLI. Run this command to install Rivet on your system: | ||
| Run this command to install Rivet on your system: | ||
|
|
||
| <Tabs> | ||
|
|
||
|
|
@@ -61,26 +57,24 @@ The executable will be available at _target/debug/rivet_. | |
|
|
||
| </Step> | ||
|
|
||
| <Step title="Initialize project & login to Rivet"> | ||
| <Step title="Initialize project"> | ||
|
|
||
| Once you've installed the Rivet CLI, run this command in your project root to create a new project: | ||
|
|
||
| ```sh | ||
| rivet init | ||
| ``` | ||
|
|
||
| Follow the instructions to initialize your project & login to Rivet. | ||
| Follow the instructions to initialize your project. | ||
|
|
||
| </Step> | ||
|
|
||
| <Step title="Deploy project"> | ||
|
|
||
| After initializing your project, now you will deploy your actor to Rivet's servers. | ||
|
|
||
| Run the following command, and replace `my-app` with the name of your project: | ||
| After initializing your project, will deploy your actor to Rivet's servers: | ||
|
|
||
| ```sh | ||
| cd my-app | ||
| cd my-app # Replace "my-app" with your project name | ||
| rivet deploy | ||
| ``` | ||
|
|
||
|
|
@@ -94,32 +88,41 @@ Once complete, visit the [Rivet Hub](https://hub.rivet.gg) to see the build you | |
|
|
||
| <Step title="Create a test actor"> | ||
|
|
||
| Now that you've uploaded a build to Rivet, we need to create an actor using that build. | ||
|
|
||
| To test the actor can be created & connected to, run: | ||
| Now that you've uploaded a build to Rivet, we need to create an actor. To test the actor can be created & connected to, run: | ||
|
|
||
| ```sh | ||
| rivet deno run -A counter_test.ts | ||
| npx tsx counter_test.ts | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Missing prerequisite instructions for installing tsx and setting up Node.js environment before running this command |
||
| ``` | ||
|
|
||
| Once complete, visit the [Rivet Hub](https://hub.rivet.gg) to see the actor you created: | ||
|
|
||
| <Image src={imgActors} alt="Actor list" /> | ||
|
|
||
| <Tip title="rivet deno command"> | ||
| The `rivet` CLI includes support for running [Deno](https://deno.com/) commands. See `rivet deno --help`. | ||
| </Tip> | ||
|
|
||
| </Step> | ||
|
|
||
| <Step title="Setup client SDK"> | ||
| <Step title="Setup client"> | ||
|
|
||
| Now that you have an actor deployed, integrate the Rivet client SDK with your actor. | ||
|
|
||
| Install the package for your language: | ||
| Install the Actor client package: | ||
|
|
||
| <CodeGroup> | ||
| ```bash {{ "title": "npm" }} | ||
| npm add @rivet-gg/actor-client | ||
| ``` | ||
|
|
||
| ```bash {{ "title": "pnpm" }} | ||
| pnpm add @rivet-gg/actor-client | ||
| ``` | ||
|
|
||
| ```bash {{ "title": "yarn" }} | ||
| yarn add @rivet-gg/actor-client | ||
| ``` | ||
|
|
||
| - <a href="https://jsr.io/@rivet-gg/actor-client" target="_blank">JavaScript</a> | ||
| - <a href="https://jsr.io/@rivet-gg/actor-client" target="_blank">TypeScript</a> | ||
| ```bash {{ "title": "bun" }} | ||
| bun add @rivet-gg/actor-client | ||
| ``` | ||
| </CodeGroup> | ||
|
|
||
| Once installed, we need to find the endpoint that your actors connect to. Run this command in your project: | ||
|
|
||
|
|
@@ -142,16 +145,6 @@ Visit the [Rivet Hub](https://hub.rivet.gg) to see the actor you created. | |
|
|
||
| </Step> | ||
|
|
||
| <Step title="Setup your editor/IDE (optional)"> | ||
|
|
||
| Rivet actors run on the [Deno](https://deno.com/) runtime. Read their guide on how to configure your IDE [here](https://docs.deno.com/runtime/getting_started/setup_your_environment/#using-an-editoride). | ||
|
|
||
| <Tip title="NodeJS & NPM compatibility"> | ||
| Rivet has [compatibility with NodeJS & NPM packages](https://docs.deno.com/runtime/fundamentals/node/). | ||
| </Tip> | ||
|
|
||
| </Step> | ||
|
|
||
| </Steps> | ||
|
|
||
| ## Next steps | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Grammar error in this sentence - 'will deploy' should be 'we will deploy' or 'you will deploy'