Files
twenty/packages/twenty-sdk
martmull e289f3056e 1895 extensibility v1 application tokens 3 (#16504)
- moves applicationRoleId to application entity
- add new `APPLICATION` FieldActorSource and `APPLICATION`
JwtTokenTypeEnum value
- create a new token with applicationId when executing a function
- when applicationId is in token, check for application.defaultRole
permissions
-use twenty-shared types in `twenty-sdk/application`
- create a new import from generate called "Twenty" that you can use
directly without having to set TWENTY_API_KEY AND TWENTY_API_URL (keep
metadata or core parameter only)
- provide to serverless unique one time BEARER TOKEN to run it

Result
<img width="977" height="566" alt="image"
src="https://github.com/user-attachments/assets/e78428a0-5b13-4975-aa13-58ee3b32450c"
/>

<img width="910" height="596" alt="image"
src="https://github.com/user-attachments/assets/6ec72bf5-7655-4093-a45e-ad269595a324"
/>

<img width="741" height="568" alt="image"
src="https://github.com/user-attachments/assets/7683944c-fd79-4417-8fb2-8e4815cc112f"
/>
2025-12-15 17:44:23 +01:00
..
2025-12-03 15:50:16 +00:00
2025-12-03 15:50:16 +00:00

Twenty logo

Twenty SDK

NPM version License Join the community on Discord

A CLI and SDK to develop, build, and publish applications that extend Twenty CRM.

  • Typesafe client and workspace entity typings
  • Builtin CLI for auth, generate, dev sync, oneoff sync, and uninstall
  • Works great with the scaffolder: create-twenty-app

Prerequisites

Installation

npm install twenty-sdk
# or
yarn add twenty-sdk

Getting started

You can either scaffold a new app or add the SDK to an existing one.

  • Start new (recommended):
    npx create-twenty-app@latest my-twenty-app
    cd my-twenty-app
    
  • Existing project: install the SDK as shown above, then use the CLI below.

CLI quickstart

# Authenticate using your API key (CLI will prompt for it)
twenty auth login

# Add a new entity to your application (guided prompts)
twenty app add

# Generate a typed Twenty client and TypeScript definitions for your workspace entities
twenty app generate

# Start dev mode: automatically syncs changes to your workspace for instant testing
twenty app dev

# Onetime sync of local changes
twenty app sync

# Uninstall the application from the current workspace
twenty app uninstall

Usage (SDK)

// Example: import what you need from the SDK
import { /* your exports */ } from 'twenty-sdk';

Publish your application

Applications are currently stored in twenty/packages/twenty-apps.

You can share your application with all Twenty users:

# pull the Twenty project
git clone https://github.com/twentyhq/twenty.git
cd twenty

# create a new branch
git checkout -b feature/my-awesome-app
git commit -m "Add new application"
git push

Our team reviews contributions for quality, security, and reusability.

Troubleshooting

  • Auth errors: run twenty auth login again and ensure the API key has the required permissions.
  • Typings out of date: run twenty app generate to refresh the client and types.
  • Not seeing changes in dev: make sure dev mode is running (twenty app dev).

Contributing