# @databricks/appkit

Core library for building Databricks applications with type-safe SQL queries, plugin architecture, and React integration.

## Enumerations[​](#enumerations "Direct link to Enumerations")

| Enumeration                                                                                         | Description                                        |
| --------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [RequestedClaimsPermissionSet](/appkit/docs/api/appkit/Enumeration.RequestedClaimsPermissionSet.md) | Permission set for Unity Catalog table access      |
| [ResourceType](/appkit/docs/api/appkit/Enumeration.ResourceType.md)                                 | Resource types from schema $defs.resourceType.enum |

## Classes[​](#classes "Direct link to Classes")

| Class                                                                       | Description                                                                                                                                    |
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [AppKitError](/appkit/docs/api/appkit/Class.AppKitError.md)                 | Base error class for all AppKit errors. Provides a consistent structure for error handling across the framework.                               |
| [AuthenticationError](/appkit/docs/api/appkit/Class.AuthenticationError.md) | Error thrown when authentication fails. Use for missing tokens, invalid credentials, or authorization failures.                                |
| [ConfigurationError](/appkit/docs/api/appkit/Class.ConfigurationError.md)   | Error thrown when configuration is missing or invalid. Use for missing environment variables, invalid settings, or setup issues.               |
| [ConnectionError](/appkit/docs/api/appkit/Class.ConnectionError.md)         | Error thrown when a connection or network operation fails. Use for database pool errors, API failures, timeouts, etc.                          |
| [ExecutionError](/appkit/docs/api/appkit/Class.ExecutionError.md)           | Error thrown when an operation execution fails. Use for statement failures, canceled operations, or unexpected states.                         |
| [InitializationError](/appkit/docs/api/appkit/Class.InitializationError.md) | Error thrown when a service or component is not properly initialized. Use when accessing services before they are ready.                       |
| [Plugin](/appkit/docs/api/appkit/Class.Plugin.md)                           | Base abstract class for creating AppKit plugins.                                                                                               |
| [ResourceRegistry](/appkit/docs/api/appkit/Class.ResourceRegistry.md)       | Central registry for tracking plugin resource requirements. Deduplication uses type + resourceKey (machine-stable); alias is for display only. |
| [ServerError](/appkit/docs/api/appkit/Class.ServerError.md)                 | Error thrown when server lifecycle operations fail. Use for server start/stop issues, configuration conflicts, etc.                            |
| [TunnelError](/appkit/docs/api/appkit/Class.TunnelError.md)                 | Error thrown when remote tunnel operations fail. Use for tunnel connection issues, message parsing failures, etc.                              |
| [ValidationError](/appkit/docs/api/appkit/Class.ValidationError.md)         | Error thrown when input validation fails. Use for invalid parameters, missing required fields, or type mismatches.                             |

## Interfaces[​](#interfaces "Direct link to Interfaces")

| Interface                                                                                                   | Description                                                                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [BasePluginConfig](/appkit/docs/api/appkit/Interface.BasePluginConfig.md)                                   | Base configuration interface for AppKit plugins                                                                                                                                                                                                               |
| [CacheConfig](/appkit/docs/api/appkit/Interface.CacheConfig.md)                                             | Configuration for caching                                                                                                                                                                                                                                     |
| [DatabaseCredential](/appkit/docs/api/appkit/Interface.DatabaseCredential.md)                               | Database credentials with OAuth token for Postgres connection                                                                                                                                                                                                 |
| [GenerateDatabaseCredentialRequest](/appkit/docs/api/appkit/Interface.GenerateDatabaseCredentialRequest.md) | Request parameters for generating database OAuth credentials                                                                                                                                                                                                  |
| [ITelemetry](/appkit/docs/api/appkit/Interface.ITelemetry.md)                                               | Plugin-facing interface for OpenTelemetry instrumentation. Provides a thin abstraction over OpenTelemetry APIs for plugins.                                                                                                                                   |
| [LakebasePoolConfig](/appkit/docs/api/appkit/Interface.LakebasePoolConfig.md)                               | Configuration for creating a Lakebase connection pool                                                                                                                                                                                                         |
| [PluginManifest](/appkit/docs/api/appkit/Interface.PluginManifest.md)                                       | Plugin manifest that declares metadata and resource requirements. Attached to plugin classes as a static property.                                                                                                                                            |
| [RequestedClaims](/appkit/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                                                                                                               |
| [RequestedResource](/appkit/docs/api/appkit/Interface.RequestedResource.md)                                 | Resource to request permissions for in Unity Catalog                                                                                                                                                                                                          |
| [ResourceEntry](/appkit/docs/api/appkit/Interface.ResourceEntry.md)                                         | Internal representation of a resource in the registry. Extends ResourceRequirement with resolution state and plugin ownership.                                                                                                                                |
| [ResourceFieldEntry](/appkit/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). |
| [ResourceRequirement](/appkit/docs/api/appkit/Interface.ResourceRequirement.md)                             | Declares a resource requirement for a plugin. Can be defined statically in a manifest or dynamically via getResourceRequirements().                                                                                                                           |
| [StreamExecutionSettings](/appkit/docs/api/appkit/Interface.StreamExecutionSettings.md)                     | Configuration for streaming execution with default and user-scoped settings                                                                                                                                                                                   |
| [TelemetryConfig](/appkit/docs/api/appkit/Interface.TelemetryConfig.md)                                     | OpenTelemetry configuration for AppKit applications                                                                                                                                                                                                           |
| [ValidationResult](/appkit/docs/api/appkit/Interface.ValidationResult.md)                                   | Result of validating all registered resources against the environment.                                                                                                                                                                                        |

## Type Aliases[​](#type-aliases "Direct link to Type Aliases")

| Type Alias                                                                    | Description                                                                                                 |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| [ConfigSchema](/appkit/docs/api/appkit/TypeAlias.ConfigSchema.md)             | Configuration schema definition for plugin config. Re-exported from the standard JSON Schema Draft 7 types. |
| [IAppRouter](/appkit/docs/api/appkit/TypeAlias.IAppRouter.md)                 | Express router type for plugin route registration                                                           |
| [ResourcePermission](/appkit/docs/api/appkit/TypeAlias.ResourcePermission.md) | Union of all possible permission levels across all resource types.                                          |
| [ToPlugin](/appkit/docs/api/appkit/TypeAlias.ToPlugin.md)                     | -                                                                                                           |

## Variables[​](#variables "Direct link to Variables")

| Variable                                       | Description          |
| ---------------------------------------------- | -------------------- |
| [sql](/appkit/docs/api/appkit/Variable.sql.md) | SQL helper namespace |

## Functions[​](#functions "Direct link to Functions")

| Function                                                                                     | Description                                                                                                                                     |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [appKitTypesPlugin](/appkit/docs/api/appkit/Function.appKitTypesPlugin.md)                   | Vite plugin to generate types for AppKit queries. Calls generateFromEntryPoint under the hood.                                                  |
| [createApp](/appkit/docs/api/appkit/Function.createApp.md)                                   | Bootstraps AppKit with the provided configuration.                                                                                              |
| [createLakebasePool](/appkit/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. |
| [generateDatabaseCredential](/appkit/docs/api/appkit/Function.generateDatabaseCredential.md) | Generate OAuth credentials for Postgres database connection using the proper Postgres API.                                                      |
| [getExecutionContext](/appkit/docs/api/appkit/Function.getExecutionContext.md)               | Get the current execution context.                                                                                                              |
| [getLakebaseOrmConfig](/appkit/docs/api/appkit/Function.getLakebaseOrmConfig.md)             | Get Lakebase connection configuration for ORMs that don't accept pg.Pool directly.                                                              |
| [getLakebasePgConfig](/appkit/docs/api/appkit/Function.getLakebasePgConfig.md)               | Get Lakebase connection configuration for PostgreSQL clients.                                                                                   |
| [getPluginManifest](/appkit/docs/api/appkit/Function.getPluginManifest.md)                   | Loads and validates the manifest from a plugin constructor. Normalizes string type/permission to strict ResourceType/ResourcePermission.        |
| [getResourceRequirements](/appkit/docs/api/appkit/Function.getResourceRequirements.md)       | Gets the resource requirements from a plugin's manifest.                                                                                        |
| [getUsernameWithApiLookup](/appkit/docs/api/appkit/Function.getUsernameWithApiLookup.md)     | Resolves the PostgreSQL username for a Lakebase connection.                                                                                     |
| [getWorkspaceClient](/appkit/docs/api/appkit/Function.getWorkspaceClient.md)                 | Get workspace client from config or SDK default auth chain                                                                                      |
| [isSQLTypeMarker](/appkit/docs/api/appkit/Function.isSQLTypeMarker.md)                       | Type guard to check if a value is a SQL type marker                                                                                             |
