Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions website/src/content/docs/connect/freestyle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,31 @@ Run this deployment script to push your application to Freestyle.
Update the runner configuration on the Rivet side to connect with your Freestyle deployment. Create a configuration script and run it after your Freestyle deployment is live:

```typescript @nocheck
import { RivetClient } from "rivetkit/client";
import { RivetClient } from "@rivetkit/engine-api-full";

const rivet = new RivetClient({
endpoint: "api.rivet.dev",
environment: "https://api.rivet.dev",
token: process.env.RIVET_API_TOKEN,
});

const FREESTYLE_DOMAIN = "my-domain.style.dev"; // Change to your desired Freestyle domain
const RIVET_NAMESPACE = "my-rivet-namespace"; // Change to your Rivet namespace

await rivet.runnerConfigs.upsert("freestyle-runner", {
serverless: {
url: `https://${FREESTYLE_DOMAIN}/start`,
runnersMargin: 1,
minRunners: 1,
maxRunners: 1,
slotsPerRunner: 1,
// Must be shorter than Freestyle request `timeout` config
requestLifespan: 60 * 5 - 5,
},
await rivet.runnerConfigsUpsert("freestyle-runner", {
namespace: RIVET_NAMESPACE,
datacenters: {
default: {
serverless: {
url: `https://${FREESTYLE_DOMAIN}/start`,
runnersMargin: 1,
minRunners: 1,
maxRunners: 1,
slotsPerRunner: 1,
// Must be shorter than Freestyle request `timeout` config
requestLifespan: 60 * 5 - 5,
},
},
},
});
```

Expand Down
24 changes: 14 additions & 10 deletions website/src/content/docs/general/pool-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,26 @@ Configure a pool via the dashboard, the API directly, or the TypeScript SDK:

<CodeGroup>

```typescript SDK
import { RivetClient } from "rivetkit/client";
```typescript SDK @nocheck
import { RivetClient } from "@rivetkit/engine-api-full";

const rivet = new RivetClient({
endpoint: "https://api.rivet.dev",
environment: "https://api.rivet.dev",
token: process.env.RIVET_TOKEN,
});

await rivet.runnerConfigs.upsert("default", {
await rivet.runnerConfigsUpsert("default", {
namespace: "default",
serverless: {
url: "https://my-app.example.com/api/rivet",
requestLifespan: 60 * 15,
actorEvictionDelay: 5,
actorEvictionPeriod: 60,
actorEvictionRate: 1,
datacenters: {
default: {
serverless: {
url: "https://my-app.example.com/api/rivet",
requestLifespan: 60 * 15,
actorEvictionDelay: 5,
actorEvictionPeriod: 60,
actorEvictionRate: 1,
},
},
},
});
```
Expand Down
Loading