Daytona.Organization reference
IdentityProvider
Section titled “IdentityProvider”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.
IdentityProvider: Single Sign-On
Section titled “IdentityProvider: Single Sign-On”export const Sso = Daytona.IdentityProvider("Sso", { issuerUrl: "https://login.example.com", clientId: "daytona", clientSecret: Config.Redacted("OIDC_CLIENT_SECRET"), emailDomains: ["example.com"], defaultRoles: [Developer],});Organization
Section titled “Organization”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.
Organization: Creating an Organization
Section titled “Organization: Creating an Organization”export const Team = Daytona.Organization("Team", { defaultRegionId: "us" });OrganizationInvitation
Section titled “OrganizationInvitation”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],});OrganizationMember
Section titled “OrganizationMember”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.
OrganizationMember: Granting a Role
Section titled “OrganizationMember: Granting a Role”export const Bob = Daytona.OrganizationMember("Bob", { user: "bob@example.com", role: "member", roles: [Developer],});OrganizationOtelConfig
Section titled “OrganizationOtelConfig”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", },});OrganizationRole
Section titled “OrganizationRole”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.
OrganizationRole: Creating a Role
Section titled “OrganizationRole: Creating a Role”export const Developer = Daytona.OrganizationRole("Developer", { description: "Run sandboxes", permissions: ["write:sandboxes", "delete:sandboxes", "read:volumes"],});OrganizationSettings
Section titled “OrganizationSettings”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",});ReadAuditLogs
Section titled “ReadAuditLogs”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.
ReadAuditLogs: Reading the Audit Log
Section titled “ReadAuditLogs: Reading the Audit Log”const audit = yield* Daytona.ReadAuditLogs();const page = yield* audit.getOrganizationAuditLogs({ limit: 50 });ReadOrganization
Section titled “ReadOrganization”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.
ReadOrganization: Checking Capacity
Section titled “ReadOrganization: Checking Capacity”const org = yield* Daytona.ReadOrganization();const capacity = yield* org.getGpuCapacity();ReadUsage
Section titled “ReadUsage”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.
ReadUsage: Usage per Sandbox
Section titled “ReadUsage: Usage per Sandbox”const usage = yield* Daytona.ReadUsage();const rows = yield* usage.listOrganizationUsageSandbox({ from, to });Webhooks
Section titled “Webhooks”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.
Webhooks: Enabling Webhooks
Section titled “Webhooks: Enabling Webhooks”export const Events = Daytona.Webhooks("Events", {});