# Function: createApp()

```ts
function createApp<T>(config: {
  cache?: CacheConfig;
  client?: WorkspaceClient;
  disableInternalTelemetry?: boolean;
  onPluginsReady?: (appkit: PluginMap<T>) => void | Promise<void>;
  plugins?: T;
  telemetry?: TelemetryConfig;
}): Promise<PluginMap<T>>;

```

Bootstraps AppKit with the provided configuration.

Initializes telemetry, cache, and service context, then registers plugins in phase order (core, normal, deferred) and awaits their setup. If a `onPluginsReady` callback is provided it runs after plugin setup but before the server starts, giving you access to the full appkit handle for registering custom routes or performing async setup. The returned object maps each plugin name to its `exports()` API, with an `asUser(req)` method for user-scoped execution.

## Type Parameters[​](#type-parameters "Direct link to Type Parameters")

| Type Parameter                                                                                                             |
| -------------------------------------------------------------------------------------------------------------------------- |
| `T` *extends* [`PluginData`](./docs/api/appkit/TypeAlias.PluginData.md)<`PluginConstructor`, `unknown`, `string`>\[] |

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter                          | Type                                                                                                                                                                                                                                                                                                                                             |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `config`                           | { `cache?`: [`CacheConfig`](./docs/api/appkit/Interface.CacheConfig.md); `client?`: `WorkspaceClient`; `disableInternalTelemetry?`: `boolean`; `onPluginsReady?`: (`appkit`: `PluginMap`<`T`>) => `void` \| `Promise`<`void`>; `plugins?`: `T`; `telemetry?`: [`TelemetryConfig`](./docs/api/appkit/Interface.TelemetryConfig.md); } |
| `config.cache?`                    | [`CacheConfig`](./docs/api/appkit/Interface.CacheConfig.md)                                                                                                                                                                                                                                                                                |
| `config.client?`                   | `WorkspaceClient`                                                                                                                                                                                                                                                                                                                                |
| `config.disableInternalTelemetry?` | `boolean`                                                                                                                                                                                                                                                                                                                                        |
| `config.onPluginsReady?`           | (`appkit`: `PluginMap`<`T`>) => `void` \| `Promise`<`void`>                                                                                                                                                                                                                                                                                      |
| `config.plugins?`                  | `T`                                                                                                                                                                                                                                                                                                                                              |
| `config.telemetry?`                | [`TelemetryConfig`](./docs/api/appkit/Interface.TelemetryConfig.md)                                                                                                                                                                                                                                                                        |

## Returns[​](#returns "Direct link to Returns")

`Promise`<`PluginMap`<`T`>>

A `PluginMap` keyed by plugin name with typed exports

## Examples[​](#examples "Direct link to Examples")

```ts
import { createApp, server } from "@databricks/appkit";

await createApp({
  plugins: [server()],
});

```

```ts
import { createApp, server, analytics } from "@databricks/appkit";

await createApp({
  plugins: [server(), analytics({})],
  onPluginsReady(appkit) {
    appkit.server.extend((app) => {
      app.get("/custom", (_req, res) => res.json({ ok: true }));
    });
  },
});

```
