Skip to content

Boat.API key reference

Source: packages/boat/src/ApiKey.ts

A scoped Boat API key: the actions it may take, and the sandboxes or environments it reaches. Give each app or CI system its own key with only what it needs.

Boat shows a key once, when it is created, so Alchemy keeps it in state as a Redacted value. Changing any prop creates a new key and revokes the old one; destroying the resource revokes it.

Creating a key needs a key with account.admin, such as the one alchemy profile edit --add Boat signs in with. A new key cannot have more actions, more sandboxes or a later expiry than the key creating it. The key a browser sign-in gets lasts a year, so keys it creates expire with it. An expired key is minted again on the next deploy.

A key for CI that manages the sandboxes it creates

export const Ci = Boat.ApiKey("Ci", { preset: "ci", ttl: "90d" });

A key that only runs commands in one sandbox

const box = yield* Boat.Sandbox("Box", {});
const key = yield* Boat.ApiKey("BoxExec", {
actions: ["sandbox.read", "exec", "file.read", "file.write"],
sandboxIds: [box.sandboxId],
});