Zum Hauptinhalt springen

Documentation Index

Fetch the complete documentation index at: https://docs.twenty.com/llms.txt

Use this file to discover all available pages before exploring further.

Twenty apps are TypeScript packages that extend your workspace with custom objects, logic, UI components, and AI capabilities. They run on the Twenty platform with full sandboxing and permission controls.

How apps work

An app is a collection of entities declared using defineEntity() functions from the twenty-sdk package. The SDK detects these declarations via AST analysis at build time and produces a manifest — a complete description of what your app adds to a workspace. These functions validate your configuration at build time and provide IDE autocompletion and type safety.
your-app/
├── src/
│   ├── application-config.ts    ← defineApplication (required, one per app)
│   ├── roles/                   ← defineRole
│   ├── objects/                 ← defineObject
│   ├── fields/                  ← defineField
│   ├── logic-functions/         ← defineLogicFunction
│   ├── front-components/        ← defineFrontComponent
│   ├── skills/                  ← defineSkill
│   ├── agents/                  ← defineAgent
│   ├── views/                   ← defineView
│   ├── navigation-menu-items/   ← defineNavigationMenuItem
│   └── page-layouts/            ← definePageLayout
├── public/                      ← Static assets (images, icons)
└── package.json
File organization is up to you. Entity detection is AST-based — the SDK finds export default defineEntity(...) calls regardless of where the file lives. The folder structure above is a convention, not a requirement.

Entity types

EntityPurposeDocs
ApplicationApp identity, default role, variablesApplication Config
RolePermission sets on objects and fieldsRoles & Permissions
ObjectCustom record types with fieldsObjects
FieldAdd fields to objects from other appsExtending Objects
RelationBidirectional links between objectsRelations
Logic FunctionServer-side TypeScript with triggersLogic Functions
SkillReusable AI agent instructionsSkills & Agents
AgentAI assistants with custom promptsSkills & Agents
Connection ProviderOAuth credentials for third-party APIsConnections
ViewPre-configured record list viewsViews
Navigation Menu ItemCustom sidebar entriesNavigation Menu Items
Page LayoutTabs and widgets on a record’s detail pagePage Layouts
Front ComponentSandboxed React UI inside TwentyFront Components
Command Menu ItemQuick actions and Cmd+K entriesCommand Menu Items

Sandboxing

  • Logic functions run in isolated Node.js processes on the server. They only access data through the typed API client, scoped to the app’s role permissions.
  • Front components run in Web Workers using Remote DOM — sandboxed from the main page but rendering native DOM elements (not iframes). They communicate with Twenty via a message-passing host API.
  • Permissions are enforced at the API level. The runtime token (TWENTY_APP_ACCESS_TOKEN) is derived from the role defined in defineApplication().

App lifecycle

┌─────────────────────────────────────────────────────────┐
│ Development                                             │
│   npx create-twenty-app → yarn twenty dev (live sync)   │
├─────────────────────────────────────────────────────────┤
│ Build & Deploy                                          │
│   yarn twenty build → yarn twenty deploy                │
├─────────────────────────────────────────────────────────┤
│ Install flow                                            │
│   upload → [pre-install] → metadata migration →         │
│   generate SDK → [post-install]                         │
├─────────────────────────────────────────────────────────┤
│ Publish                                                 │
│   npm publish → appears in Twenty marketplace           │
└─────────────────────────────────────────────────────────┘
  • yarn twenty dev — watches your source files and live-syncs changes to a connected Twenty server. The typed API client is regenerated automatically when the schema changes.
  • yarn twenty build — compiles TypeScript, bundles logic functions and front components with esbuild, and produces a manifest.
  • Pre/post-install hooks — optional functions that run during installation. See Install Hooks for details.

Next steps

Config

Application identity, default role, and install hooks.

Data

Objects, fields, and bidirectional relations.

Logic

Logic functions, skills, agents, and OAuth connections.

Layout

Views, navigation, page layouts, front components.

Operations

CLI, testing, remotes, CI, and publishing your app.