Skip to main content

Minimal app

This app provisions one table and displays it through a native Data Workspace surface.

import {defineApp, ref, resources} from '@twl-tool/app-sdk';

export default defineApp({
key: 'reading-list',
name: 'Reading List',
version: '1.0.0',
permissions: ['data-workspace.read'],
ui: {
surfaces: [{
key: 'library',
label: 'Library',
type: 'dataWorkspaceView',
table: ref('dataWorkspaceTables', 'articles'),
}],
},
resources: {
dataWorkspaces: {
main: resources.workspace({title: 'Reading List'}),
},
dataWorkspaceBases: {
main: resources.base({
workspace: ref('dataWorkspaces', 'main'),
title: 'Library',
}),
},
dataWorkspaceTables: {
articles: resources.table({
base: ref('dataWorkspaceBases', 'main'),
title: 'Articles',
columns: {
title: {type: 'single_line_text', required: true},
url: {type: 'url', unique: true},
read: {type: 'checkbox', defaultValue: false},
},
views: {
unread: resources.view({
title: 'Unread',
filters: [{columnSlug: 'read', operator: 'equals', value: false}],
}),
},
}),
},
},
});

defineApp() supplies the root Space and selects library as the default surface. Add a workflow or Frontend Page only when the product needs one.