Facade API

Learn how to add Facade API to your application to simplify the usage of Web SDK.

Univer's architecture is designed to cover complex requirements, which makes it difficult to use directly. The Facade API provides a simpler layer on top of it.

This page describes how to add the Facade API to your application. The Features section lists the main Facade API for each feature. For the complete list, see the API reference of the plugin that provides it.

Caution

Some Facade APIs are asynchronous, especially the APIs that modify data, which usually return a Promise. If you need to read data immediately after a change, await the call or chain .then(). Otherwise the result may be unexpected. To determine which APIs return a Promise, see the API reference of the corresponding plugin.

Integrating Facade API in plugin mode

Installation

When Univer is installed in plugin mode, each plugin contains its own part of the Facade API implementation, and those parts attach to a global Facade API root object. For plugins that provide Facade API, import the corresponding implementation as needed:

TypeScript
import { FUniver } from '@univerjs/core/facade'import '@univerjs/ui/facade'import '@univerjs/docs/facade'import '@univerjs/docs-ui/facade'

Caution

Not every plugin includes a facade package. Each feature's documentation states whether it does.

Usage

The Facade API wraps an existing Univer instance. Create the instance first, then build the API from it:

TypeScript
import { FUniver } from '@univerjs/core/facade'const univerAPI = FUniver.newAPI(univer)

Cautions

Not every Facade API takes effect as soon as it is called. Some only work at a particular lifecycle stage. If a call has no effect, run it at a later stage:

TypeScript
const disposable = univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, ({ stage }) => {  if (stage === univerAPI.Enum.LifecycleStages.Rendered) {    // Code to be executed when the lifecycle stage is Rendered  }  if (stage === univerAPI.Enum.LifecycleStages.Steady) {    // Code to be executed when the lifecycle stage is Steady  }})

Integrating Facade API in preset mode

In preset mode, the preset imports the Facade API for the features it includes. Creating a Univer instance returns a matching Facade API instance, univerAPI, which can be used directly.

How is this guide?

© 2026 DreamNum Co., Ltd.