Facade API
Learn how to use Facade API in a Univer Bases application.
Facade API is the layer that the application uses instead of working with the Bases model directly. It covers routine operations such as creating Bases, tables, fields, records, and views, as well as filters, sorts, groups, selections, and UI navigation.
Caution
Changes to the Base model are synchronous. UI activation methods return promises and should be awaited.
Enable facade entries
Import the facade entry for each Bases capability that the application uses:
TypeScript
import { FUniver } from '@univerjs/core/facade'import '@univerjs-pro/bases/facade'import '@univerjs-pro/bases-ui/facade'Create the API object after registering the Univer instance and its required plugins:
TypeScript
const univerAPI = FUniver.newAPI(univer)Next steps
With the Facade extensions enabled, the following pages cover the remaining topics:
- General API covers shared commands, events, undo and redo, UI extensions, networking, enums, and utilities.
- Univer Bases API explains how to create and read Bases and how to work with their model and UI state.
- Bases facade reference provides the complete method reference.
How is this guide?