@@ -75,46 +75,24 @@ Why this layout:
7575 "dev": "NODE_ENV=development tsx watch server/index.ts",
7676 "build": "npm run build:server && npm run build:client",
7777 "build:server": "tsdown --out-dir build server/index.ts",
78- "build:client": "cd client && npm run build",
78+ "build:client": "tsc -b && vite build --config client/vite.config.ts ",
7979 "start": "node build/index.mjs"
8080 },
8181 "dependencies": {
82- "@databricks/appkit": "^0.0.2"
82+ "@databricks/appkit": "^0.1.2"
83+ "@databricks/appkit-ui": "^0.1.2",
84+ "react": "^19.2.3",
85+ "react-dom": "^19.2.3"
8386 },
8487 "devDependencies": {
8588 "@types/node": "^20.0.0",
89+ "@types/react": "^19.0.0",
90+ "@types/react-dom": "^19.0.0",
91+ "@vitejs/plugin-react": "^5.1.1",
8692 "tsdown": "^0.15.7",
8793 "tsx": "^4.19.0",
88- "typescript": "~5.6.0"
89- }
90- }
91- ```
92-
93- ### `client/package.json`
94-
95- ```json
96- {
97- "name": "client",
98- "private": true,
99- "version": "0.0.0",
100- "type": "module",
101- "scripts": {
102- "dev": "vite",
103- "build": "vite build",
104- "preview": "vite preview"
105- },
106- "dependencies": {
107- "@databricks/appkit-ui": "^0.0.2",
108- "react": "^18.0.0",
109- "react-dom": "^18.0.0",
110- "recharts": "^3.0.0"
111- },
112- "devDependencies": {
113- "@types/react": "^18.0.0",
114- "@types/react-dom": "^18.0.0",
115- "@vitejs/plugin-react": "^5.0.0",
11694 "typescript": "~5.6.0",
117- "vite": "^6.0.0 "
95+ "vite": "^7.2.4 "
11896 }
11997}
12098```
@@ -208,7 +186,6 @@ await createApp({
208186```bash
209187# Install dependencies
210188npm install
211- cd client && npm install && cd ..
212189
213190# Development (starts backend + Vite dev server)
214191npm run dev
@@ -225,19 +202,14 @@ If you already have a React/Vite app and want to add AppKit:
225202### 1. Install dependencies
226203
227204```bash
228- npm install @databricks/appkit
229- npm install -D tsx tsdown
205+ npm install @databricks/appkit @databricks/appkit-ui react react-dom
206+ npm install -D tsx tsdown vite @vitejs/plugin-react typescript
230207
231208# If you don't already have a client/ folder, create one and move your Vite app into it:
232209# - move index.html -> client/index.html
233210# - move vite.config.ts -> client/vite.config.ts
234211# - move src/ -> client/src/
235212#
236- # Then install client deps:
237- cd client
238- npm install @databricks/appkit-ui react react-dom recharts
239- npm install -D vite @vitejs/plugin-react typescript
240- cd ..
241213```
242214
243215### 2. Create `server/index.ts` (new file)
@@ -258,7 +230,7 @@ await createApp({
258230 "dev": "NODE_ENV=development tsx watch server/index.ts",
259231 "build": "npm run build:server && npm run build:client",
260232 "build:server": "tsdown --out-dir build server/index.ts",
261- "build:client": "cd client && npm run build",
233+ "build:client": "tsc -b && vite build --config client/vite.config.ts ",
262234 "start": "node build/index.mjs"
263235 }
264236}
@@ -276,7 +248,7 @@ await createApp({
276248import { createApp, server, analytics } from "@databricks/appkit";
277249
278250await createApp({
279- plugins: [server(), analytics({} )],
251+ plugins: [server(), analytics()],
280252});
281253```
282254
@@ -312,13 +284,17 @@ These are typically **provided by Databricks Apps runtime** (exact set can vary
312284
313285For local development, you need to authenticate with Databricks. Options:
314286
315- **Option 1: Databricks CLI profile (recommended)**
287+ **Option 1: Databricks CLI Auth (recommended)**
316288
317289```bash
318290# Configure once
319- databricks configure --profile my-profile
291+ databricks auth login --host [host] --profile [profile-name]
292+
293+ # If you used `DEFAULT` as the profile name then you can just run
320294
321- # Then run with profile
295+ `npm run dev`
296+
297+ # To run with a specific profile
322298DATABRICKS_CONFIG_PROFILE=my-profile npm run dev
323299# If your Databricks SDK expects a different variable name, try:
324300# DATABRICKS_PROFILE=my-profile npm run dev
@@ -462,7 +438,7 @@ HTTP endpoints exposed (mounted under `/api/analytics`):
462438Formats:
463439
464440- `format: "JSON"` (default) returns JSON rows
465- - `format: "ARROW"` returns an Arrow “external links ” payload over SSE, then the client fetches binary Arrow from `/api/analytics/arrow-result/:jobId`
441+ - `format: "ARROW"` returns an Arrow “statement_id ” payload over SSE, then the client fetches binary Arrow from `/api/analytics/arrow-result/:jobId`
466442
467443### Request context (`getRequestContext()`)
468444
@@ -980,6 +956,108 @@ function LoadingCard() {
980956}
981957```
982958
959+ ## Stylesheet
960+
961+ In the main css file import the following
962+
963+ ```css
964+ @import "@databricks/appkit-ui/styles.css";
965+ ```
966+
967+ That will provide a default theme for the app using css variables.
968+
969+ ### Customizing theme (light/dark mode)
970+
971+ - Full list of variables to customize the theme.
972+
973+ ```css
974+ @import "@databricks/appkit-ui/styles.css";
975+
976+ :root {
977+ --radius: 0.625rem;
978+ --background: oklch(1 0 0);
979+ --foreground: oklch(0.141 0.005 285.823);
980+ --card: oklch(1 0 0);
981+ --card-foreground: oklch(0.141 0.005 285.823);
982+ --popover: oklch(1 0 0);
983+ --popover-foreground: oklch(0.141 0.005 285.823);
984+ --primary: oklch(0.21 0.006 285.885);
985+ --primary-foreground: oklch(0.985 0 0);
986+ --secondary: oklch(0.967 0.001 286.375);
987+ --secondary-foreground: oklch(0.21 0.006 285.885);
988+ --muted: oklch(0.967 0.001 286.375);
989+ --muted-foreground: oklch(0.552 0.016 285.938);
990+ --accent: oklch(0.967 0.001 286.375);
991+ --accent-foreground: oklch(0.21 0.006 285.885);
992+ --destructive: oklch(0.577 0.245 27.325);
993+ --destructive-foreground: oklch(0.985 0 0);
994+ --success: oklch(0.603 0.135 166.892);
995+ --success-foreground: oklch(1 0 0);
996+ --warning: oklch(0.795 0.157 78.748);
997+ --warning-foreground: oklch(0.199 0.027 238.732);
998+ --border: oklch(0.92 0.004 286.32);
999+ --input: oklch(0.92 0.004 286.32);
1000+ --ring: oklch(0.705 0.015 286.067);
1001+ --chart-1: oklch(0.646 0.222 41.116);
1002+ --chart-2: oklch(0.6 0.118 184.704);
1003+ --chart-3: oklch(0.398 0.07 227.392);
1004+ --chart-4: oklch(0.828 0.189 84.429);
1005+ --chart-5: oklch(0.769 0.188 70.08);
1006+ --sidebar: oklch(0.985 0 0);
1007+ --sidebar-foreground: oklch(0.141 0.005 285.823);
1008+ --sidebar-primary: oklch(0.21 0.006 285.885);
1009+ --sidebar-primary-foreground: oklch(0.985 0 0);
1010+ --sidebar-accent: oklch(0.967 0.001 286.375);
1011+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
1012+ --sidebar-border: oklch(0.92 0.004 286.32);
1013+ --sidebar-ring: oklch(0.705 0.015 286.067);
1014+ }
1015+
1016+ @media (prefers-color-scheme: dark) {
1017+ :root {
1018+ --background: oklch(0.141 0.005 285.823);
1019+ --foreground: oklch(0.985 0 0);
1020+ --card: oklch(0.21 0.006 285.885);
1021+ --card-foreground: oklch(0.985 0 0);
1022+ --popover: oklch(0.21 0.006 285.885);
1023+ --popover-foreground: oklch(0.985 0 0);
1024+ --primary: oklch(0.92 0.004 286.32);
1025+ --primary-foreground: oklch(0.21 0.006 285.885);
1026+ --secondary: oklch(0.274 0.006 286.033);
1027+ --secondary-foreground: oklch(0.985 0 0);
1028+ --muted: oklch(0.274 0.006 286.033);
1029+ --muted-foreground: oklch(0.705 0.015 286.067);
1030+ --accent: oklch(0.274 0.006 286.033);
1031+ --accent-foreground: oklch(0.985 0 0);
1032+ --destructive: oklch(0.704 0.191 22.216);
1033+ --destructive-foreground: oklch(0.985 0 0);
1034+ --success: oklch(0.67 0.12 167);
1035+ --success-foreground: oklch(1 0 0);
1036+ --warning: oklch(0.83 0.165 85);
1037+ --warning-foreground: oklch(0.199 0.027 238.732);
1038+ --border: oklch(1 0 0 / 10%);
1039+ --input: oklch(1 0 0 / 15%);
1040+ --ring: oklch(0.552 0.016 285.938);
1041+ --chart-1: oklch(0.488 0.243 264.376);
1042+ --chart-2: oklch(0.696 0.17 162.48);
1043+ --chart-3: oklch(0.769 0.188 70.08);
1044+ --chart-4: oklch(0.627 0.265 303.9);
1045+ --chart-5: oklch(0.645 0.246 16.439);
1046+ --sidebar: oklch(0.21 0.006 285.885);
1047+ --sidebar-foreground: oklch(0.985 0 0);
1048+ --sidebar-primary: oklch(0.488 0.243 264.376);
1049+ --sidebar-primary-foreground: oklch(0.985 0 0);
1050+ --sidebar-accent: oklch(0.274 0.006 286.033);
1051+ --sidebar-accent-foreground: oklch(0.985 0 0);
1052+ --sidebar-border: oklch(1 0 0 / 10%);
1053+ --sidebar-ring: oklch(0.552 0.016 285.938);
1054+ }
1055+ }
1056+
1057+ ```
1058+
1059+ - If any variable is changed, it must be changed for both light and dark mode.
1060+
9831061## Type generation (QueryRegistry + IntelliSense)
9841062
9851063Goal: generate `client/src/appKitTypes.d.ts` so query keys, params, and result rows are type-safe.
@@ -1054,7 +1132,6 @@ env:
10541132 - `tsx` is in devDependencies for dev server
10551133 - `dev` script uses `NODE_ENV=development tsx watch server/index.ts`
10561134 - `client/index.html` exists with `<div id="root"></div>` and script pointing to `client/src/main.tsx`
1057- - `client/package.json` exists and includes `@databricks/appkit-ui`
10581135
10591136- **Backend**
10601137 - `await createApp({ plugins: [...] })` is used (or `void createApp` with intent)
0 commit comments