Skip to content

Commit 3554d05

Browse files
authored
Update API key information in the getting started guide (#264)
1 parent e224d1b commit 3554d05

File tree

6 files changed

+3
-21
lines changed

6 files changed

+3
-21
lines changed

docs/stately-sky-getting-started.mdx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,7 @@ You’ll need the workflow’s URL to reference it from the starter project.
6363

6464
![Stately Sky modal shows the Traffic light workflow listed under Existing deploys. The workflow has its own URL with the options to Copy URL or delete alongside.](../static/assets/sky-getting-started/editor-deployed-workflow.png)
6565

66-
## Step 4: Add your API key to the starter project
67-
68-
1. Open [the starter project](https://github.com/statelyai/sky-starter-app) in your code editor.
69-
2. Install the packages using your package manager of choice:
70-
71-
```bash npm2yarn
72-
npm install
73-
```
74-
75-
3. At the project’s root, create a `.env` file to hold your API key.
76-
4. Set the following two variables in the `.env` file; paste your API key as the value for both these keys:
77-
78-
- `SKY_API_KEY`: used by the `@xstate/cli` to fetch the machine config.
79-
- `VITE_SKY_API_KEY`: used by the Vite React app to connect to Sky.
80-
81-
![.env file](../static/assets/sky-getting-started/code-env-file.png)
82-
83-
## Step 5: Add the actor in the starter project
66+
## Step 4: Add the actor in the starter project
8467

8568
After adding the API key, you’ll need to create an actor.
8669

@@ -91,6 +74,7 @@ After adding the API key, you’ll need to create an actor.
9174
import { actorFromStately } from '@statelyai/sky';
9275

9376
const actor = actorFromStately({
77+
apiKey: 'paste your API key here',
9478
url: 'paste your Sky url here',
9579
sessionId: 'your session id here',
9680
});
@@ -105,7 +89,7 @@ The session ID is used to shard the multiplayer session. Each actor has a unique
10589

10690
:::
10791

108-
## Step 6: Fetching the config from Sky
92+
## Step 5: Fetching the config from Sky
10993

11094
Now that we’ve created the actor, we need to fetch the config from Sky. Doing so will download and generate the machine configuration file in our repo, giving us type safety when interacting with the running actor!
11195

@@ -134,8 +118,6 @@ Add your generated `sky.ts` files to source control.
134118

135119
:::
136120

137-
![traffic light actor](../static/assets/sky-getting-started/code-traffic-light-with-config.png)
138-
139121
## Finishing up
140122

141123
And that’s it! You can now interact with your running actor in much the same way you would with local actors, like sending events with the `send()` function. Sky is still in its early days, so there are some limitations and things to remember. Specifically:
23.3 KB
Loading
Binary file not shown.
-6.38 KB
Loading
47 Bytes
Loading
-5.57 KB
Loading

0 commit comments

Comments
 (0)