Railway.Workspace reference
AuditLog
Section titled “AuditLog”Source:
src/Railway/AuditLog.ts
List workspace audit logs. Query-only — Railway has no audit-log create/update/delete, so this is a catalog helper, not a resource.
Defaults to the current token workspace. Pass project /
environment to filter. The result may be empty.
AuditLog: List logs
Section titled “AuditLog: List logs”Workspace logs
const logs = yield* Railway.listAuditLogs();Filter by project
const site = yield* Railway.Project("Site");const logs = yield* Railway.listAuditLogs({ project: site, environment: site,});AuditLog: Get by id
Section titled “AuditLog: Get by id”const log = yield* Railway.getAuditLog({ id: logs[0].id });AuditLog: Event types
Section titled “AuditLog: Event types”const types = yield* Railway.listAuditLogEventTypes();UsageLimit
Section titled “UsageLimit”Source:
src/Railway/Usage.ts
A Railway.UsageLimit is a soft/hard dollar cap on a workspace
customer. One limit per customer. usageLimitRemove is idempotent.
UsageLimit: Query usage
Section titled “UsageLimit: Query usage”usage is a catalog helper — not a resource. It returns
aggregated rows for the current workspace (or a project).
const rows = yield* Railway.usage({ measurements: ["CPU_USAGE", "MEMORY_USAGE_GB"],});UsageLimit: Set a limit
Section titled “UsageLimit: Set a limit”Omit workspace / project to cap the current token workspace. A
number is the soft dollar cap.
Soft cap
const cap = yield* Railway.UsageLimit("SpendCap", { limit: 50,});Soft and hard
const cap = yield* Railway.UsageLimit("SpendCap", { project: site, limit: { softLimitDollars: 50, hardLimitDollars: 100 },});UsageLimit: Module-scope declarations
Section titled “UsageLimit: Module-scope declarations”Resource-valued props accept the resource or an Effect producing it.
import * as Railway from "alchemy/Railway";
export const Site = Railway.Project("Site");export const SpendCap = Railway.UsageLimit("SpendCap", { project: Site, limit: 50,});