Extend
Cloud Code
Cloud Code lets you register reusable JSX or JavaScript components on the platform and reference them from DSDL through
type: cloud_code. It fills the gap when standard widgets are not enough.
Core concepts
- Each Cloud Code record uses
nameas the stable identifier. DSDL refers to it throughcode_name. - A component can have its own default datasource or receive a datasource at execution time.
- Cloud Code belongs to an organization and is isolated across tenants.
Use in DSDL
---
type: cloud_code
title: Customer Health
code_name: customer_health_panel
---
During rendering, the system resolves the component by code_name. If no matching record exists, the page returns an error-style cloud_code widget.
Management endpoints
| Endpoint | Description | Access |
|---|---|---|
GET /api/v1/cloud-codes | List components in the current organization | Authenticated users |
GET /api/v1/cloud-codes/:id | Read component detail | Authenticated users |
POST /api/v1/cloud-codes | Create a component | admin / editor |
PUT /api/v1/cloud-codes/:id | Update a component | admin / editor |
DELETE /api/v1/cloud-codes/:id | Delete a component | admin / editor |
Execution endpoints
Cloud Code components can trigger backend SQL through dedicated execution APIs:
POST /api/v1/cloud-code-execute/:id/queryfor read-only queriesPOST /api/v1/cloud-code-execute/:id/mutatefor write operations
{
"sql": "SELECT * FROM orders WHERE id = :id",
"params": { "id": 1001 },
"datasource_id": "optional"
}
Execution limits
- The
queryendpoint only allows read-only SQL and blocks DML and DDL. - The
mutateendpoint allows DML but still blocks DDL such asDROP,ALTER, andCREATE. - Execution validates that both the Cloud Code component and datasource belong to the current organization.
Cloud Code is best treated as a controlled extension surface, not as an unrestricted backend scripting channel.
Good use cases
- Business status panels, approval prompts, and compound information blocks.
- Interactions more complex than standard chart widgets support.
- Custom frontend rendering on top of controlled query and mutate APIs.
Operational notes
- If a Cloud Code record is deleted, reports that reference the same
code_namewill fail. - Use stable names and avoid renaming
namefrequently. - If a component depends on a dedicated datasource, bind it at the component layer instead of passing it every time.