@databricks/appkit-ui 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CLAUDE.md +11 -0
  2. package/NOTICE.md +1 -0
  3. package/README.md +3 -20
  4. package/dist/cli/commands/generate-types.js +15 -13
  5. package/dist/cli/commands/generate-types.js.map +1 -1
  6. package/dist/cli/commands/setup.js +2 -2
  7. package/dist/cli/commands/setup.js.map +1 -1
  8. package/dist/js/config.d.ts +24 -0
  9. package/dist/js/config.d.ts.map +1 -0
  10. package/dist/js/config.js +49 -0
  11. package/dist/js/config.js.map +1 -0
  12. package/dist/js/index.d.ts +2 -1
  13. package/dist/js/index.js +2 -1
  14. package/dist/react/genie/genie-chat-message-list.d.ts.map +1 -1
  15. package/dist/react/genie/genie-chat-message-list.js +5 -4
  16. package/dist/react/genie/genie-chat-message-list.js.map +1 -1
  17. package/dist/react/genie/genie-chat-message.d.ts.map +1 -1
  18. package/dist/react/genie/genie-chat-message.js +7 -6
  19. package/dist/react/genie/genie-chat-message.js.map +1 -1
  20. package/dist/react/genie/genie-query-visualization.d.ts.map +1 -1
  21. package/dist/react/genie/genie-query-visualization.js +4 -3
  22. package/dist/react/genie/genie-query-visualization.js.map +1 -1
  23. package/dist/react/genie/index.d.ts +1 -1
  24. package/dist/react/genie/types.d.ts +2 -1
  25. package/dist/react/genie/types.d.ts.map +1 -1
  26. package/dist/react/genie/types.js +6 -0
  27. package/dist/react/genie/types.js.map +1 -0
  28. package/dist/react/genie/use-genie-chat.d.ts.map +1 -1
  29. package/dist/react/genie/use-genie-chat.js +60 -23
  30. package/dist/react/genie/use-genie-chat.js.map +1 -1
  31. package/dist/react/hooks/index.d.ts +5 -2
  32. package/dist/react/hooks/index.js +3 -0
  33. package/dist/react/hooks/types.d.ts +30 -1
  34. package/dist/react/hooks/types.d.ts.map +1 -1
  35. package/dist/react/hooks/use-plugin-config.d.ts +25 -0
  36. package/dist/react/hooks/use-plugin-config.d.ts.map +1 -0
  37. package/dist/react/hooks/use-plugin-config.js +32 -0
  38. package/dist/react/hooks/use-plugin-config.js.map +1 -0
  39. package/dist/react/hooks/use-serving-invoke.d.ts +30 -0
  40. package/dist/react/hooks/use-serving-invoke.d.ts.map +1 -0
  41. package/dist/react/hooks/use-serving-invoke.js +82 -0
  42. package/dist/react/hooks/use-serving-invoke.js.map +1 -0
  43. package/dist/react/hooks/use-serving-stream.d.ts +35 -0
  44. package/dist/react/hooks/use-serving-stream.d.ts.map +1 -0
  45. package/dist/react/hooks/use-serving-stream.js +101 -0
  46. package/dist/react/hooks/use-serving-stream.js.map +1 -0
  47. package/dist/react/index.d.ts +6 -3
  48. package/dist/react/index.js +4 -1
  49. package/dist/shared/src/index.d.ts +1 -1
  50. package/dist/shared/src/plugin.d.ts +12 -1
  51. package/dist/shared/src/plugin.d.ts.map +1 -0
  52. package/docs/api/appkit/Class.Plugin.md +83 -20
  53. package/docs/api/appkit/Function.appKitServingTypesPlugin.md +24 -0
  54. package/docs/api/appkit/Function.extractServingEndpoints.md +22 -0
  55. package/docs/api/appkit/Function.findServerFile.md +20 -0
  56. package/docs/api/appkit/Interface.EndpointConfig.md +23 -0
  57. package/docs/api/appkit/Interface.ServingEndpointEntry.md +30 -0
  58. package/docs/api/appkit/Interface.ServingEndpointRegistry.md +3 -0
  59. package/docs/api/appkit/TypeAlias.ExecutionResult.md +36 -0
  60. package/docs/api/appkit/TypeAlias.ServingFactory.md +15 -0
  61. package/docs/api/appkit.md +39 -31
  62. package/docs/app-management.md +1 -1
  63. package/docs/architecture.md +1 -1
  64. package/docs/development/ai-assisted-development.md +2 -2
  65. package/docs/development/local-development.md +1 -1
  66. package/docs/development/remote-bridge.md +1 -1
  67. package/docs/development/templates.md +93 -0
  68. package/docs/development.md +1 -1
  69. package/docs/faq.md +66 -0
  70. package/docs/plugins/caching.md +3 -1
  71. package/docs/plugins/execution-context.md +1 -1
  72. package/docs/plugins/lakebase.md +1 -1
  73. package/docs/plugins/serving.md +223 -0
  74. package/docs.md +2 -2
  75. package/llms.txt +11 -0
  76. package/package.json +60 -58
  77. package/sbom.cdx.json +1 -0
@@ -0,0 +1,36 @@
1
+ # Type Alias: ExecutionResult\<T>
2
+
3
+ ```ts
4
+ type ExecutionResult<T> =
5
+ | {
6
+ data: T;
7
+ ok: true;
8
+ }
9
+ | {
10
+ message: string;
11
+ ok: false;
12
+ status: number;
13
+ };
14
+
15
+ ```
16
+
17
+ Discriminated union for plugin execution results.
18
+
19
+ Replaces the previous `T | undefined` return type on `execute()`.
20
+
21
+ On failure, the HTTP status code is preserved from:
22
+
23
+ * `AppKitError` subclasses (via `statusCode`)
24
+ * Any `Error` with a numeric `statusCode` property (e.g. `ApiError`)
25
+ * All other errors default to status 500
26
+
27
+ In production, error messages from non-AppKitError sources are handled as:
28
+
29
+ * 4xx errors: original message is preserved (client-facing by design)
30
+ * 5xx errors: replaced with "Server error" to prevent information leakage
31
+
32
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
33
+
34
+ | Type Parameter |
35
+ | -------------- |
36
+ | `T` |
@@ -0,0 +1,15 @@
1
+ # Type Alias: ServingFactory
2
+
3
+ ```ts
4
+ type ServingFactory = keyof ServingEndpointRegistry extends never ? (alias?: string) => ServingEndpointHandle : <K>(alias: K) => ServingEndpointHandle<ServingEndpointRegistry[K]["request"], ServingEndpointRegistry[K]["response"]>;
5
+
6
+ ```
7
+
8
+ Factory function returned by `AppKit.serving`.
9
+
10
+ This is a conditional type that adapts based on whether `ServingEndpointRegistry` has been populated via module augmentation (generated by `appKitServingTypesPlugin()`):
11
+
12
+ * **Registry empty (default):** `(alias?: string) => ServingEndpointHandle` — accepts any alias string with untyped request/response.
13
+ * **Registry populated:** `<K>(alias: K) => ServingEndpointHandle<...>` — restricts `alias` to known endpoint keys and infers typed request/response from the registry entry.
14
+
15
+ Run `appKitServingTypesPlugin()` in your Vite config to generate the registry augmentation and enable full type safety.
@@ -27,32 +27,37 @@ Core library for building Databricks applications with type-safe SQL queries, pl
27
27
 
28
28
  ## Interfaces[​](#interfaces "Direct link to Interfaces")
29
29
 
30
- | Interface | Description |
31
- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
- | [BasePluginConfig](./docs/api/appkit/Interface.BasePluginConfig.md) | Base configuration interface for AppKit plugins |
33
- | [CacheConfig](./docs/api/appkit/Interface.CacheConfig.md) | Configuration for the CacheInterceptor. Controls TTL, size limits, storage backend, and probabilistic cleanup. |
34
- | [DatabaseCredential](./docs/api/appkit/Interface.DatabaseCredential.md) | Database credentials with OAuth token for Postgres connection |
35
- | [GenerateDatabaseCredentialRequest](./docs/api/appkit/Interface.GenerateDatabaseCredentialRequest.md) | Request parameters for generating database OAuth credentials |
36
- | [ITelemetry](./docs/api/appkit/Interface.ITelemetry.md) | Plugin-facing interface for OpenTelemetry instrumentation. Provides a thin abstraction over OpenTelemetry APIs for plugins. |
37
- | [LakebasePoolConfig](./docs/api/appkit/Interface.LakebasePoolConfig.md) | Configuration for creating a Lakebase connection pool |
38
- | [PluginManifest](./docs/api/appkit/Interface.PluginManifest.md) | Plugin manifest that declares metadata and resource requirements. Attached to plugin classes as a static property. Extends the shared PluginManifest with strict resource types. |
39
- | [RequestedClaims](./docs/api/appkit/Interface.RequestedClaims.md) | Optional claims for fine-grained Unity Catalog table permissions When specified, the returned token will be scoped to only the requested tables |
40
- | [RequestedResource](./docs/api/appkit/Interface.RequestedResource.md) | Resource to request permissions for in Unity Catalog |
41
- | [ResourceEntry](./docs/api/appkit/Interface.ResourceEntry.md) | Internal representation of a resource in the registry. Extends ResourceRequirement with resolution state and plugin ownership. |
42
- | [ResourceFieldEntry](./docs/api/appkit/Interface.ResourceFieldEntry.md) | Defines a single field for a resource. Each field has its own environment variable and optional description. Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instance\_name, database\_name or scope, key). |
43
- | [ResourceRequirement](./docs/api/appkit/Interface.ResourceRequirement.md) | Declares a resource requirement for a plugin. Can be defined statically in a manifest or dynamically via getResourceRequirements(). Narrows the generated base: type ResourceType enum, permission ResourcePermission union. |
44
- | [StreamExecutionSettings](./docs/api/appkit/Interface.StreamExecutionSettings.md) | Execution settings for streaming endpoints. Extends PluginExecutionSettings with SSE stream configuration. |
45
- | [TelemetryConfig](./docs/api/appkit/Interface.TelemetryConfig.md) | OpenTelemetry configuration for AppKit applications |
46
- | [ValidationResult](./docs/api/appkit/Interface.ValidationResult.md) | Result of validating all registered resources against the environment. |
30
+ | Interface | Description |
31
+ | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
+ | [BasePluginConfig](./docs/api/appkit/Interface.BasePluginConfig.md) | Base configuration interface for AppKit plugins |
33
+ | [CacheConfig](./docs/api/appkit/Interface.CacheConfig.md) | Configuration for the CacheInterceptor. Controls TTL, size limits, storage backend, and probabilistic cleanup. |
34
+ | [DatabaseCredential](./docs/api/appkit/Interface.DatabaseCredential.md) | Database credentials with OAuth token for Postgres connection |
35
+ | [EndpointConfig](./docs/api/appkit/Interface.EndpointConfig.md) | - |
36
+ | [GenerateDatabaseCredentialRequest](./docs/api/appkit/Interface.GenerateDatabaseCredentialRequest.md) | Request parameters for generating database OAuth credentials |
37
+ | [ITelemetry](./docs/api/appkit/Interface.ITelemetry.md) | Plugin-facing interface for OpenTelemetry instrumentation. Provides a thin abstraction over OpenTelemetry APIs for plugins. |
38
+ | [LakebasePoolConfig](./docs/api/appkit/Interface.LakebasePoolConfig.md) | Configuration for creating a Lakebase connection pool |
39
+ | [PluginManifest](./docs/api/appkit/Interface.PluginManifest.md) | Plugin manifest that declares metadata and resource requirements. Attached to plugin classes as a static property. Extends the shared PluginManifest with strict resource types. |
40
+ | [RequestedClaims](./docs/api/appkit/Interface.RequestedClaims.md) | Optional claims for fine-grained Unity Catalog table permissions When specified, the returned token will be scoped to only the requested tables |
41
+ | [RequestedResource](./docs/api/appkit/Interface.RequestedResource.md) | Resource to request permissions for in Unity Catalog |
42
+ | [ResourceEntry](./docs/api/appkit/Interface.ResourceEntry.md) | Internal representation of a resource in the registry. Extends ResourceRequirement with resolution state and plugin ownership. |
43
+ | [ResourceFieldEntry](./docs/api/appkit/Interface.ResourceFieldEntry.md) | Defines a single field for a resource. Each field has its own environment variable and optional description. Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instance\_name, database\_name or scope, key). |
44
+ | [ResourceRequirement](./docs/api/appkit/Interface.ResourceRequirement.md) | Declares a resource requirement for a plugin. Can be defined statically in a manifest or dynamically via getResourceRequirements(). Narrows the generated base: type → ResourceType enum, permission → ResourcePermission union. |
45
+ | [ServingEndpointEntry](./docs/api/appkit/Interface.ServingEndpointEntry.md) | Shape of a single registry entry. |
46
+ | [ServingEndpointRegistry](./docs/api/appkit/Interface.ServingEndpointRegistry.md) | Registry interface for serving endpoint type generation. Empty by default — augmented by the Vite type generator's `.d.ts` output via module augmentation. When populated, provides autocomplete for alias names and typed request/response/chunk per endpoint. |
47
+ | [StreamExecutionSettings](./docs/api/appkit/Interface.StreamExecutionSettings.md) | Execution settings for streaming endpoints. Extends PluginExecutionSettings with SSE stream configuration. |
48
+ | [TelemetryConfig](./docs/api/appkit/Interface.TelemetryConfig.md) | OpenTelemetry configuration for AppKit applications |
49
+ | [ValidationResult](./docs/api/appkit/Interface.ValidationResult.md) | Result of validating all registered resources against the environment. |
47
50
 
48
51
  ## Type Aliases[​](#type-aliases "Direct link to Type Aliases")
49
52
 
50
53
  | Type Alias | Description |
51
54
  | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
52
55
  | [ConfigSchema](./docs/api/appkit/TypeAlias.ConfigSchema.md) | Configuration schema definition for plugin config. Re-exported from the standard JSON Schema Draft 7 types. |
56
+ | [ExecutionResult](./docs/api/appkit/TypeAlias.ExecutionResult.md) | Discriminated union for plugin execution results. |
53
57
  | [IAppRouter](./docs/api/appkit/TypeAlias.IAppRouter.md) | Express router type for plugin route registration |
54
58
  | [PluginData](./docs/api/appkit/TypeAlias.PluginData.md) | Tuple of plugin class, config, and name. Created by `toPlugin()` and passed to `createApp()`. |
55
59
  | [ResourcePermission](./docs/api/appkit/TypeAlias.ResourcePermission.md) | Union of all possible permission levels across all resource types. |
60
+ | [ServingFactory](./docs/api/appkit/TypeAlias.ServingFactory.md) | Factory function returned by `AppKit.serving`. |
56
61
  | [ToPlugin](./docs/api/appkit/TypeAlias.ToPlugin.md) | Factory function type returned by `toPlugin()`. Accepts optional config and returns a PluginData tuple. |
57
62
 
58
63
  ## Variables[​](#variables "Direct link to Variables")
@@ -63,17 +68,20 @@ Core library for building Databricks applications with type-safe SQL queries, pl
63
68
 
64
69
  ## Functions[​](#functions "Direct link to Functions")
65
70
 
66
- | Function | Description |
67
- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
68
- | [appKitTypesPlugin](./docs/api/appkit/Function.appKitTypesPlugin.md) | Vite plugin to generate types for AppKit queries. Calls generateFromEntryPoint under the hood. |
69
- | [createApp](./docs/api/appkit/Function.createApp.md) | Bootstraps AppKit with the provided configuration. |
70
- | [createLakebasePool](./docs/api/appkit/Function.createLakebasePool.md) | Create a Lakebase pool with appkit's logger integration. Telemetry automatically uses appkit's OpenTelemetry configuration via global registry. |
71
- | [generateDatabaseCredential](./docs/api/appkit/Function.generateDatabaseCredential.md) | Generate OAuth credentials for Postgres database connection using the proper Postgres API. |
72
- | [getExecutionContext](./docs/api/appkit/Function.getExecutionContext.md) | Get the current execution context. |
73
- | [getLakebaseOrmConfig](./docs/api/appkit/Function.getLakebaseOrmConfig.md) | Get Lakebase connection configuration for ORMs that don't accept pg.Pool directly. |
74
- | [getLakebasePgConfig](./docs/api/appkit/Function.getLakebasePgConfig.md) | Get Lakebase connection configuration for PostgreSQL clients. |
75
- | [getPluginManifest](./docs/api/appkit/Function.getPluginManifest.md) | Loads and validates the manifest from a plugin constructor. Normalizes string type/permission to strict ResourceType/ResourcePermission. |
76
- | [getResourceRequirements](./docs/api/appkit/Function.getResourceRequirements.md) | Gets the resource requirements from a plugin's manifest. |
77
- | [getUsernameWithApiLookup](./docs/api/appkit/Function.getUsernameWithApiLookup.md) | Resolves the PostgreSQL username for a Lakebase connection. |
78
- | [getWorkspaceClient](./docs/api/appkit/Function.getWorkspaceClient.md) | Get workspace client from config or SDK default auth chain |
79
- | [isSQLTypeMarker](./docs/api/appkit/Function.isSQLTypeMarker.md) | Type guard to check if a value is a SQL type marker |
71
+ | Function | Description |
72
+ | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
73
+ | [appKitServingTypesPlugin](./docs/api/appkit/Function.appKitServingTypesPlugin.md) | Vite plugin to generate TypeScript types for AppKit serving endpoints. Fetches OpenAPI schemas from Databricks and generates a .d.ts with ServingEndpointRegistry module augmentation. |
74
+ | [appKitTypesPlugin](./docs/api/appkit/Function.appKitTypesPlugin.md) | Vite plugin to generate types for AppKit queries. Calls generateFromEntryPoint under the hood. |
75
+ | [createApp](./docs/api/appkit/Function.createApp.md) | Bootstraps AppKit with the provided configuration. |
76
+ | [createLakebasePool](./docs/api/appkit/Function.createLakebasePool.md) | Create a Lakebase pool with appkit's logger integration. Telemetry automatically uses appkit's OpenTelemetry configuration via global registry. |
77
+ | [extractServingEndpoints](./docs/api/appkit/Function.extractServingEndpoints.md) | Extract serving endpoint config from a server file by AST-parsing it. Looks for `serving({ endpoints: { alias: { env: "..." }, ... } })` calls and extracts the endpoint alias names and their environment variable mappings. |
78
+ | [findServerFile](./docs/api/appkit/Function.findServerFile.md) | Find the server entry file by checking candidate paths in order. |
79
+ | [generateDatabaseCredential](./docs/api/appkit/Function.generateDatabaseCredential.md) | Generate OAuth credentials for Postgres database connection using the proper Postgres API. |
80
+ | [getExecutionContext](./docs/api/appkit/Function.getExecutionContext.md) | Get the current execution context. |
81
+ | [getLakebaseOrmConfig](./docs/api/appkit/Function.getLakebaseOrmConfig.md) | Get Lakebase connection configuration for ORMs that don't accept pg.Pool directly. |
82
+ | [getLakebasePgConfig](./docs/api/appkit/Function.getLakebasePgConfig.md) | Get Lakebase connection configuration for PostgreSQL clients. |
83
+ | [getPluginManifest](./docs/api/appkit/Function.getPluginManifest.md) | Loads and validates the manifest from a plugin constructor. Normalizes string type/permission to strict ResourceType/ResourcePermission. |
84
+ | [getResourceRequirements](./docs/api/appkit/Function.getResourceRequirements.md) | Gets the resource requirements from a plugin's manifest. |
85
+ | [getUsernameWithApiLookup](./docs/api/appkit/Function.getUsernameWithApiLookup.md) | Resolves the PostgreSQL username for a Lakebase connection. |
86
+ | [getWorkspaceClient](./docs/api/appkit/Function.getWorkspaceClient.md) | Get workspace client from config or SDK default auth chain |
87
+ | [isSQLTypeMarker](./docs/api/appkit/Function.isSQLTypeMarker.md) | Type guard to check if a value is a SQL type marker |
@@ -5,7 +5,7 @@ Manage your AppKit application throughout its lifecycle using the Databricks CLI
5
5
  ## Prerequisites[​](#prerequisites "Direct link to Prerequisites")
6
6
 
7
7
  * [Node.js](https://nodejs.org) v22+ environment with `npm`
8
- * Databricks CLI (v0.287.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
8
+ * Databricks CLI (v0.295.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
9
9
 
10
10
  ## Create app[​](#create-app "Direct link to Create app")
11
11
 
@@ -59,7 +59,7 @@ The Node.js backend layer built with `@databricks/appkit`:
59
59
  Integration with Databricks services:
60
60
 
61
61
  * **SQL Warehouses**: Execute analytical queries with Arrow or JSON format
62
- * **Lakebase V1 (Provisioned)**: Access data from Lakebase Provisioned. Support for Lakebase Autoscaling coming soon.
62
+ * **Lakebase Autoscaling**: OLTP database access with automatic OAuth token refresh
63
63
 
64
64
  ## See also[​](#see-also "Direct link to See also")
65
65
 
@@ -3,7 +3,7 @@
3
3
  ## Prerequisites[​](#prerequisites "Direct link to Prerequisites")
4
4
 
5
5
  * [Node.js](https://nodejs.org) v22+ environment with `npm`
6
- * Databricks CLI (v0.287.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
6
+ * Databricks CLI (v0.295.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
7
7
  * A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](./docs.md#quick-start-options) for more details.
8
8
 
9
9
  AppKit integrates with AI coding assistants through the Agent Skills.
@@ -13,7 +13,7 @@ AppKit integrates with AI coding assistants through the Agent Skills.
13
13
  To install the Databricks Agent Skills for your preferred AI assistant, run:
14
14
 
15
15
  ```bash
16
- databricks experimental aitools skills install
16
+ databricks experimental aitools install
17
17
 
18
18
  ```
19
19
 
@@ -3,7 +3,7 @@
3
3
  ## Prerequisites[​](#prerequisites "Direct link to Prerequisites")
4
4
 
5
5
  * [Node.js](https://nodejs.org) v22+ environment with `npm`
6
- * Databricks CLI (v0.287.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
6
+ * Databricks CLI (v0.295.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
7
7
  * A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](./docs.md#quick-start-options) for more details.
8
8
 
9
9
  Once your app is bootstrapped according to the [Manual quick start](./docs.md#manual-quick-start) guide, you can start the development server with hot reload for both UI and backend code.
@@ -3,7 +3,7 @@
3
3
  ## Prerequisites[​](#prerequisites "Direct link to Prerequisites")
4
4
 
5
5
  * [Node.js](https://nodejs.org) v22+ environment with `npm`
6
- * Databricks CLI (v0.287.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
6
+ * Databricks CLI (v0.295.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
7
7
  * A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](./docs.md#quick-start-options) for more details.
8
8
 
9
9
  Remote bridge allows you to develop against a deployed backend while keeping your UI and queries local. This is useful for testing against production data or debugging deployed backend code without redeploying your app.
@@ -0,0 +1,93 @@
1
+ # Templates
2
+
3
+ AppKit uses a template system powered by the Databricks CLI's `databricks apps init` command. Templates define the project structure, and `.tmpl` files are processed with Go's `text/template` engine to generate customized output.
4
+
5
+ ## How `.tmpl` files work[​](#how-tmpl-files-work "Direct link to how-tmpl-files-work")
6
+
7
+ Any file ending in `.tmpl` is processed by the CLI during `databricks apps init`:
8
+
9
+ 1. The `.tmpl` suffix is stripped (e.g. `.env.tmpl` → `.env`)
10
+ 2. Go template expressions are evaluated and substituted
11
+ 3. The rendered file is written to the output directory
12
+
13
+ Files named with a `_` prefix are renamed to `.` prefix (e.g. `_gitignore` → `.gitignore`).
14
+
15
+ ### Template variables[​](#template-variables "Direct link to Template variables")
16
+
17
+ | Variable | Description |
18
+ | ----------------- | ---------------------------------------------------------------------------- |
19
+ | `.projectName` | Project name from `--name` or interactive prompt |
20
+ | `.workspaceHost` | Databricks workspace URL |
21
+ | `.profile` | Databricks CLI profile name (empty if using host-based auth) |
22
+ | `.appDescription` | App description |
23
+ | `.plugins.<name>` | Non-nil for each selected plugin, enabling conditionals |
24
+ | `.dotEnv.content` | Generated `.env` content from plugin resources |
25
+ | `.dotEnv.example` | Generated `.env.example` content with placeholders |
26
+ | `.bundle.*` | Generated `databricks.yml` sections (variables, resources, target variables) |
27
+ | `.appEnv` | Generated `app.yaml` env entries |
28
+
29
+ ### Conditional content[​](#conditional-content "Direct link to Conditional content")
30
+
31
+ Use Go template conditionals to include/exclude code based on selected plugins:
32
+
33
+ ```go
34
+ {{- if .plugins.analytics}}
35
+ import { analytics } from '@databricks/appkit';
36
+ {{- end}}
37
+
38
+ ```
39
+
40
+ ## `appkit.plugins.json`[​](#appkitpluginsjson "Direct link to appkitpluginsjson")
41
+
42
+ The plugin manifest drives the CLI's behavior during `databricks apps init`:
43
+
44
+ * **Plugin selection UI** — selectable plugins shown in the interactive prompt
45
+ * **Resource prompts** — required/optional resources prompt the user for values (e.g. SQL Warehouse ID)
46
+ * **`.dotEnv` population** — resource fields with an `env` property are written to `.env`
47
+ * **`app.yaml` generation** — resource fields produce `env` + `valueFrom` entries
48
+ * **`databricks.yml` generation** — resource fields produce bundle variables and app resource entries
49
+
50
+ ### Resource field properties[​](#resource-field-properties "Direct link to Resource field properties")
51
+
52
+ Each resource field in the manifest can have these properties:
53
+
54
+ | Property | Description |
55
+ | -------------- | ----------------------------------------------------------------------------------- |
56
+ | `env` | Environment variable name written to `.env` and `app.yaml` |
57
+ | `description` | Shown in the interactive prompt and bundle variable description |
58
+ | `localOnly` | Only written to `.env` for local dev; excluded from `app.yaml` and bundle variables |
59
+ | `bundleIgnore` | Excluded from `databricks.yml` variables (but still in `.env`) |
60
+ | `value` | Default value used when no user input is provided |
61
+ | `resolve` | Auto-populated by CLI from API calls instead of prompting (see below) |
62
+ | `examples` | Example values shown in field descriptions |
63
+
64
+ ### Resolvers[​](#resolvers "Direct link to Resolvers")
65
+
66
+ Fields with a `resolve` property are auto-populated by the CLI from API calls rather than user prompts. The format is `<type>:<field>`.
67
+
68
+ Currently only the `postgres` resource type has a resolver. Given the user-provided `branch` and `database` resource names, it derives:
69
+
70
+ | Resolve key | Description |
71
+ | ----------------------- | ----------------------------------------------------------- |
72
+ | `postgres:host` | Postgres host from the branch's read-write endpoint |
73
+ | `postgres:databaseName` | Postgres database name from the database resource |
74
+ | `postgres:endpointPath` | Lakebase endpoint resource name from the branch's endpoints |
75
+
76
+ Example field definition:
77
+
78
+ ```json
79
+ {
80
+ "host": {
81
+ "env": "PGHOST",
82
+ "localOnly": true,
83
+ "resolve": "postgres:host",
84
+ "description": "Postgres host for local development."
85
+ }
86
+ }
87
+
88
+ ```
89
+
90
+ ## See also[​](#see-also "Direct link to See also")
91
+
92
+ * [Plugin management](./docs/plugins/plugin-management.md) — `appkit plugin sync`, `appkit plugin create`
93
+ * [Configuration](./docs/configuration.md) — environment variables
@@ -5,7 +5,7 @@ AppKit provides multiple development workflows to suit different needs: local de
5
5
  ## Prerequisites[​](#prerequisites "Direct link to Prerequisites")
6
6
 
7
7
  * [Node.js](https://nodejs.org) v22+ environment with `npm`
8
- * Databricks CLI (v0.287.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
8
+ * Databricks CLI (v0.295.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
9
9
  * A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](./docs.md#quick-start-options) for more details.
10
10
 
11
11
  ## Development flows[​](#development-flows "Direct link to Development flows")
package/docs/faq.md ADDED
@@ -0,0 +1,66 @@
1
+ # FAQ
2
+
3
+ ## Integrations[​](#integrations "Direct link to Integrations")
4
+
5
+ ### What Databricks services are available through AppKit?[​](#what-databricks-services-are-available-through-appkit "Direct link to What Databricks services are available through AppKit?")
6
+
7
+ AppKit provides built-in integrations with the following Databricks services via its [plugin system](./docs/plugins.md):
8
+
9
+ | Plugin | Databricks Service | What It Does |
10
+ | ---------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------- |
11
+ | [Analytics](./docs/plugins/analytics.md) | SQL Warehouses | Execute parameterized SQL queries with built-in caching, retry, and Arrow support |
12
+ | [Lakebase](./docs/plugins/lakebase.md) | Lakebase Autoscaling (PostgreSQL) | Relational database access via standard pg.Pool with automatic OAuth token refresh |
13
+ | [Genie](./docs/plugins/genie.md) | AI/BI Genie Spaces | Natural language data queries with conversation management and streaming |
14
+ | [Files](./docs/plugins/files.md) | Unity Catalog Volumes | Multi-volume file operations (list, read, upload, download, delete, preview) |
15
+ | [Serving](./docs/plugins/serving.md) | Model Serving | Authenticated proxy to Model Serving endpoints with invoke and streaming support |
16
+ | [Server](./docs/plugins/server.md) | N/A | Express HTTP server with static file serving, Vite dev mode, and plugin route injection |
17
+
18
+ Stay tuned for new plugins as we constantly expand integrations!
19
+
20
+ ### Can I add custom integrations?[​](#can-i-add-custom-integrations "Direct link to Can I add custom integrations?")
21
+
22
+ Yes. AppKit's plugin architecture is extensible - you can create custom plugins using the CLI (`npx appkit plugin create`) or manually. See the [creating custom plugins guide](./docs/plugins/custom-plugins.md).
23
+
24
+ ## Authentication[​](#authentication "Direct link to Authentication")
25
+
26
+ ### How does authentication work in AppKit apps?[​](#how-does-authentication-work-in-appkit-apps "Direct link to How does authentication work in AppKit apps?")
27
+
28
+ AppKit apps are designed to run on [Databricks Apps](https://docs.databricks.com/aws/en/dev-tools/databricks-apps/), which handles user authentication and authorization. Databricks Apps forwards user identity to the app via request headers, and AppKit integrates with this through the `.asUser(req)` pattern for on-behalf-of (OBO) execution — allowing plugins to act on behalf of the authenticated user.
29
+
30
+ For details on how authentication and authorization work in Databricks Apps, see the [official auth documentation](https://docs.databricks.com/aws/en/dev-tools/databricks-apps/auth).
31
+
32
+ ## Databases[​](#databases "Direct link to Databases")
33
+
34
+ *Also: Lakebase, PostgreSQL, OLTP*
35
+
36
+ ### How does AppKit handle databases?[​](#how-does-appkit-handle-databases "Direct link to How does AppKit handle databases?")
37
+
38
+ AppKit is a TypeScript SDK (Express + React) and does not manage databases directly.
39
+
40
+ To add database support, use the [Lakebase plugin](./docs/plugins/lakebase.md), which integrates with Lakebase Autoscaling.
41
+
42
+ AppKit also uses Lakebase for caching when it is available (see the [caching](#does-appkit-support-caching) section below).
43
+
44
+ You can manage Lakebase Autoscaling projects and branches using the dedicated agent skill from [Databricks Agent Skills](./docs/development/ai-assisted-development.md), installed with the Databricks CLI.
45
+
46
+ ### How does database setup and permission management work in AppKit?[​](#how-does-database-setup-and-permission-management-work-in-appkit "Direct link to How does database setup and permission management work in AppKit?")
47
+
48
+ AppKit apps can have an attached Lakebase Autoscaling instance. No database is bundled by default - you add one by configuring the [Lakebase plugin](./docs/plugins/lakebase.md). When running `databricks apps init` and selecting the Lakebase plugin, the selected database is automatically attached as an app resource after deployment.
49
+
50
+ With [AI-assisted development](./docs/development/ai-assisted-development.md), you can also ask the Agent to create a Lakebase project and branch for you.
51
+
52
+ When deployed, a Databricks app uses its Service Principal for schema and table creation. If you configure the Lakebase Autoscaling project as an [app resource](https://docs.databricks.com/aws/en/dev-tools/databricks-apps/resources), the necessary connect and create permissions are granted automatically to the app's Service Principal.
53
+
54
+ ### Does AppKit support Lakebase Provisioned?[​](#does-appkit-support-lakebase-provisioned "Direct link to Does AppKit support Lakebase Provisioned?")
55
+
56
+ No. AppKit only supports Lakebase Autoscaling. Lakebase Provisioned databases are not supported by the [Lakebase plugin](./docs/plugins/lakebase.md) or Lakebase agent skill from [Databricks Agent Skills](./docs/development/ai-assisted-development.md).
57
+
58
+ ## Caching[​](#caching "Direct link to Caching")
59
+
60
+ ### Does AppKit support caching?[​](#does-appkit-support-caching "Direct link to Does AppKit support caching?")
61
+
62
+ Yes. The [Analytics plugin](./docs/plugins/analytics.md) - used for executing SQL queries against Databricks SQL Warehouses - supports an optional cache layer.
63
+
64
+ Caching is configured per plugin and can use either [Lakebase Autoscaling](https://docs.databricks.com/aws/en/oltp/) or an in-memory store, depending on the configuration.
65
+
66
+ If the Lakebase Autoscaling connection is configured, the AppKit-based app creates an `appkit` schema in the configured database with internal tables required for caching.
@@ -16,7 +16,9 @@ await createApp({
16
16
 
17
17
  ```
18
18
 
19
- Storage auto-selects **Lakebase V1 (Provisioned) persistent cache when healthy**, otherwise falls back to in-memory. Support for Lakebase Autoscaling coming soon.
19
+ Storage auto-selects **Lakebase Autoscaling persistent cache when healthy**, otherwise falls back to in-memory.
20
+
21
+ The database-backed cache requires the same Lakebase environment variables as the [Lakebase plugin](./docs/plugins/lakebase.md#environment-variables) (`PGHOST`, `PGDATABASE`, `LAKEBASE_ENDPOINT`, `PGSSLMODE`).
20
22
 
21
23
  ## Plugin-level caching[​](#plugin-level-caching "Direct link to Plugin-level caching")
22
24
 
@@ -42,4 +42,4 @@ Exported from `@databricks/appkit`:
42
42
 
43
43
  ## Development mode behavior[​](#development-mode-behavior "Direct link to Development mode behavior")
44
44
 
45
- In local development (`NODE_ENV=development`), if `asUser(req)` is called without a user token, it logs a warning and falls back to the service principal.
45
+ In local development (`NODE_ENV=development`), if `asUser(req)` is called without a user token, it logs a warning and skips user impersonation the operation runs with the default credentials configured for the app instead.
@@ -17,7 +17,7 @@ The easiest way to get started with the Lakebase plugin is to use the Databricks
17
17
  ### Prerequisites[​](#prerequisites "Direct link to Prerequisites")
18
18
 
19
19
  * [Node.js](https://nodejs.org) v22+ environment with `npm`
20
- * Databricks CLI (v0.287.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
20
+ * Databricks CLI (v0.295.0 or higher): install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
21
21
  * A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](./docs.md#quick-start-options) for more details.
22
22
 
23
23
  ### Steps[​](#steps "Direct link to Steps")