Add defineUninstallLogicFunction hook for applications (#23227)
This commit is contained in:
@@ -101,3 +101,11 @@ yarn twenty dev:function:exec
|
||||
```
|
||||
|
||||
Run again after rebuilding to verify idempotency.
|
||||
|
||||
## Uninstall Hook
|
||||
|
||||
Use `defineUninstallLogicFunction` for best-effort cleanup of external resources when the app is uninstalled (deprovision API resources, delete remaining bots, revoke webhooks). Failures are logged and never block the uninstall.
|
||||
|
||||
Uninstall hook files live alongside other logic functions (typically `src/logic-functions/uninstall.ts`). Kebab-case filename, one export per file.
|
||||
|
||||
The hook runs before the app's metadata, data, and code are removed, so handlers can still query the app's objects and records. Handlers receive `UninstallPayload` (`{ version?: string }`).
|
||||
|
||||
Reference in New Issue
Block a user