Skip to content

Commit 844d4f3

Browse files
Copilothotlong
andcommitted
Address code review feedback - improve documentation
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent ad5dbbc commit 844d4f3

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

apps/web/src/components/objectui/ObjectUIExample.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,23 @@ interface ObjectUIExampleProps {
1919
}
2020

2121
/**
22-
* Example component showing how to integrate @object-ui components
22+
* Example component showing how to integrate @object-ui components.
23+
*
24+
* The SchemaRenderer will automatically fetch object metadata from the ObjectStack
25+
* backend and render the appropriate view based on the schema definition.
2326
*/
2427
export function ObjectUIExample({
2528
objectName,
2629
view = 'grid',
2730
recordId
2831
}: ObjectUIExampleProps) {
2932
return (
30-
<div className="object-ui-container">
31-
<SchemaRenderer
32-
adapter={objectUIAdapter}
33-
objectName={objectName}
34-
view={view}
35-
recordId={recordId}
36-
/>
37-
</div>
33+
<SchemaRenderer
34+
adapter={objectUIAdapter}
35+
objectName={objectName}
36+
view={view}
37+
recordId={recordId}
38+
/>
3839
);
3940
}
4041

apps/web/src/lib/object-ui-adapter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ import { createObjectStackAdapter } from '@object-ui/data-objectstack';
1212
*
1313
* This adapter allows ObjectUI components to fetch data from the ObjectStack backend
1414
* through the @objectstack/client API.
15+
*
16+
* Note: The adapter uses 'baseUrl' (not 'baseURL') as per the @objectstack/client API.
17+
* This follows Node.js URL conventions where 'baseUrl' is used for configuration.
1518
*/
1619
export const objectUIAdapter = createObjectStackAdapter({
17-
// Base URL for ObjectStack API (note: baseUrl not baseURL)
1820
baseUrl: import.meta.env.VITE_API_BASE_URL || '/api/v1',
1921

2022
// Optional: Token for authentication (if not using cookies)
23+
// By default, the adapter uses cookie-based authentication from better-auth
2124
// token: 'your-auth-token',
2225
});
2326

0 commit comments

Comments
 (0)