Skip to content

Daytona.Organization reference

Source: packages/daytona/src/IdentityProvider.ts

An OIDC identity provider for single sign-on into the Daytona organization. Needs an organization with SSO enabled (an enterprise plan); other organizations reject it.

export const Sso = Daytona.IdentityProvider("Sso", {
issuerUrl: "https://login.example.com",
clientId: "daytona",
clientSecret: Config.Redacted("OIDC_CLIENT_SECRET"),
emailDomains: ["example.com"],
defaultRoles: [Developer],
});

Source: packages/daytona/src/Organization.ts

A new Daytona organization, owned by the signed-in user. Creating organizations needs a user login, not an organization API key: an API key already belongs to exactly one organization. To configure the organization your key belongs to, use OrganizationSettings.

export const Team = Daytona.Organization("Team", { defaultRegionId: "us" });

Source: packages/daytona/src/OrganizationInvitation.ts

Invite someone to the Daytona organization by email, with a base role and custom OrganizationRoles. Destroying it cancels the invitation if it hasn’t been accepted; an accepted invitation leaves the member in place.

OrganizationInvitation: Inviting a Developer

Section titled “OrganizationInvitation: Inviting a Developer”
export const Alice = Daytona.OrganizationInvitation("Alice", {
email: "alice@example.com",
roles: [Developer],
});

Source: packages/daytona/src/OrganizationMember.ts

The access of an existing member of the Daytona organization: their base role and custom OrganizationRoles. Use it to manage who can do what as code. To add someone, use OrganizationInvitation.

export const Bob = Daytona.OrganizationMember("Bob", {
user: "bob@example.com",
role: "member",
roles: [Developer],
});

Source: packages/daytona/src/OrganizationOtelConfig.ts

Export the organization’s sandbox telemetry (logs, traces, metrics) to your own OpenTelemetry backend. One per organization; destroying it stops the export.

OrganizationOtelConfig: Exporting Telemetry

Section titled “OrganizationOtelConfig: Exporting Telemetry”
export const Telemetry = Daytona.OrganizationOtelConfig("Telemetry", {
endpoint: "https://api.axiom.co",
headers: {
Authorization: Config.Redacted("AXIOM_TOKEN"),
"X-Axiom-Dataset": "daytona",
},
});

Source: packages/daytona/src/OrganizationRole.ts

A custom role in the Daytona organization: a named set of permissions to give members, through OrganizationInvitation or OrganizationMember.

export const Developer = Daytona.OrganizationRole("Developer", {
description: "Run sandboxes",
permissions: ["write:sandboxes", "delete:sandboxes", "read:volumes"],
});

Source: packages/daytona/src/OrganizationSettings.ts

Settings of the Daytona organization the credentials belong to: the default region, the queue timeout for creates waiting on capacity, and experimental flags. Only the settings you declare are changed.

The organization always exists, so this resource captures the settings it finds on first deploy and puts them back on destroy.

OrganizationSettings: Configuring the Organization

Section titled “OrganizationSettings: Configuring the Organization”
export const Settings = Daytona.OrganizationSettings("Settings", {
defaultRegionId: "eu",
defaultQueueTimeout: "1 minute",
});

Source: packages/daytona/src/ReadAuditLogs.ts

Read the organization’s audit log at runtime: who created, started, deleted or changed what, and with which API key.

The host gets its own Daytona API key with read:audit_logs.

const audit = yield* Daytona.ReadAuditLogs();
const page = yield* audit.getOrganizationAuditLogs({ limit: 50 });

Source: packages/daytona/src/ReadOrganization.ts

Read the organization’s limits and usage at runtime: current usage against quotas, which sandbox classes and GPUs are available, and the shared regions. Use it to pick a region or refuse work before hitting a quota.

The host gets its own Daytona API key with read:limits.

const org = yield* Daytona.ReadOrganization();
const capacity = yield* org.getGpuCapacity();

Source: packages/daytona/src/ReadUsage.ts

Read the organization’s compute usage at runtime: aggregated totals, a chart over time, and usage per sandbox. Use it to bill your own users for the sandboxes you run for them.

The host gets its own Daytona API key with read:billing.

const usage = yield* Daytona.ReadUsage();
const rows = yield* usage.listOrganizationUsageSandbox({ from, to });

Source: packages/daytona/src/Webhooks.ts

Turn on webhooks for the Daytona organization: sandbox, snapshot and volume events delivered to endpoints you register in Daytona’s webhook portal. Daytona delivers through Svix, which owns the endpoints, so this resource only enables delivery; open the portal with getWebhookControllerAppPortalAccess (on ReadOrganization) to add endpoints. Webhooks can’t be turned off again through the API, so destroy leaves them enabled.

export const Events = Daytona.Webhooks("Events", {});