Skip to content

Commit cea3a43

Browse files
wixysamcursoragent
andauthored
Improve SDK documentation TOC structure and organization (#131)
Enhanced the SDK documentation with better TOC visibility and organization: - Added CSS to show depth-2 TOC items (methods) while hiding deeper levels - Grouped type definitions under "Type Definitions" heading for entities, functions, and agents modules - Added "Overview" heading to organize intro sections consistently across modules - Renamed "EntityHandler" section to "Entity Handler Methods" for clarity - Split integrations methods into "Core Integrations Methods" and "Custom Integrations Methods" - Added structured subsections in Overview for all modules: - auth: Features, Authentication Modes - agents: Key Features, Conversation Structure, Authentication Modes - analytics: Best Practices, Authentication Modes - entities: Entity Handlers, Built-in User Entity, Generated Types - integrations: Integration Types, Authentication Modes - functions, connectors, app-logs: Authentication Modes - Updated terminology to use "custom workspace integrations" with link to documentation - Demoted example headings in type definitions to prevent TOC clutter Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d9e5b2a commit cea3a43

11 files changed

Lines changed: 648 additions & 25 deletions

File tree

scripts/mintlify-post-processing/file-processing/file-processing.js

Lines changed: 553 additions & 0 deletions
Large diffs are not rendered by default.

scripts/mintlify-post-processing/file-processing/styling.css

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,10 @@ a:has(code) {
117117
color: #ff8844 !important; /* light orange */
118118
}
119119

120-
/* Hide nested TOC items on interface and type-alias pages */
121-
body:has([data-page-href*="/content/interfaces/"])
122-
.toc
123-
li[data-depth]:not([data-depth="1"]),
124-
body:has([data-page-href*="/content/type-aliases/"])
125-
.toc
126-
li[data-depth]:not([data-depth="1"]) {
120+
/* Show section headings (depth 0) and methods (depth 1), but hide method details (depth 2+) */
121+
/* This applies to SDK interface and type-alias pages */
122+
123+
/* Hide Parameters, Returns, Examples (depth 2) on SDK docs pages */
124+
.toc li.toc-item[data-depth="2"] {
127125
display: none !important;
128126
}

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export type {
5959

6060
export type {
6161
IntegrationsModule,
62-
IntegrationPackage,
6362
IntegrationEndpointFunction,
6463
CoreIntegrations,
6564
InvokeLLMParams,

src/modules/agents.types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ export interface AgentsModuleConfig {
183183
* send messages, and subscribe to realtime updates. Conversations can be used
184184
* for chat interfaces, support systems, or any interactive AI app.
185185
*
186+
* ## Key Features
187+
*
186188
* The agents module enables you to:
187189
*
188190
* - **Create conversations** with agents defined in the app.
@@ -192,12 +194,16 @@ export interface AgentsModuleConfig {
192194
* - **Attach metadata** to conversations for tracking context, categories, priorities, or linking to external systems.
193195
* - **Generate WhatsApp connection URLs** for users to interact with agents through WhatsApp.
194196
*
197+
* ## Conversation Structure
198+
*
195199
* The agents module operates with a two-level hierarchy:
196200
*
197201
* 1. **Conversations**: Top-level containers that represent a dialogue with a specific agent. Each conversation has a unique ID, is associated with an agent by name, and belongs to the user who created it. Conversations can include optional metadata for tracking app-specific context like ticket IDs, categories, or custom fields.
198202
*
199203
* 2. **Messages**: Individual exchanges within a conversation. Each message has a role, content, and optional metadata like token usage, tool calls, file attachments, and reasoning information. Messages are stored as an array within their parent conversation.
200204
*
205+
* ## Authentication Modes
206+
*
201207
* This module is available to use with a client in all authentication modes:
202208
*
203209
* - **Anonymous or User authentication** (`base44.agents`): Access is scoped to the current user's permissions. Users must be authenticated to create and access conversations.

src/modules/analytics.types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ export type AnalyticsModuleOptions = {
8383
*
8484
* <Note> Analytics events tracked with this module appear as custom event cards in the [Analytics dashboard](/documentation/performance-and-seo/app-analytics).</Note>
8585
*
86+
* ## Best Practices
87+
*
8688
* When tracking events:
8789
*
8890
* - Choose clear, descriptive event names in snake_case like `signup_button_click` or `purchase_completed` rather than generic names like `click`.
8991
* - Include relevant context in your properties such as identifiers like `product_id`, measurements like `price`, and flags like `is_first_purchase`.
9092
*
93+
* ## Authentication Modes
94+
*
9195
* This module is only available in user authentication mode (`base44.analytics`).
9296
*/
9397
export interface AnalyticsModule {

src/modules/app-logs.types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*
44
* This module provides a method to log user activity. The logs are reflected in the Analytics page in the app dashboard.
55
*
6+
* ## Authentication Modes
7+
*
68
* This module is available to use with a client in all authentication modes.
79
*/
810
export interface AppLogsModule {

src/modules/auth.types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ export interface AuthModuleOptions {
105105
/**
106106
* Authentication module for managing user authentication and authorization. The module automatically stores tokens in local storage when available and manages authorization headers for API requests.
107107
*
108+
* ## Features
109+
*
108110
* This module provides comprehensive authentication functionality including:
109111
* - Email/password login and registration
110112
* - Token management
@@ -113,6 +115,8 @@ export interface AuthModuleOptions {
113115
* - OTP verification
114116
* - User invitations
115117
*
118+
* ## Authentication Modes
119+
*
116120
* The auth module is only available in user authentication mode (`base44.auth`).
117121
*/
118122
export interface AuthModule {

src/modules/connectors.types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export interface ConnectorAccessTokenResponse {
3434
* the API calls you make. This is useful when you need custom API interactions that aren't
3535
* covered by Base44's pre-built integrations.
3636
*
37+
* ## Authentication Modes
38+
*
3739
* This module is only available to use with a client in service role authentication mode, which means it can only be used in backend environments.
3840
*
3941
* ## Dynamic Types

src/modules/entities.types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,14 @@ type DynamicEntitiesModule = {
460460
* - **Anonymous or User authentication** (`base44.entities`): Access is scoped to the current user's permissions. Anonymous users can only access public entities, while authenticated users can access entities they have permission to view or modify.
461461
* - **Service role authentication** (`base44.asServiceRole.entities`): Operations have elevated admin-level permissions. Can access all entities that the app's admin role has access to.
462462
*
463+
* ## Entity Handlers
464+
*
465+
* An entity handler is the object you get when you access an entity through `base44.entities.EntityName`. Every entity in your app automatically gets a handler with CRUD methods for managing records.
466+
*
467+
* For example, `base44.entities.Task` is an entity handler for Task records, and `base44.entities.User` is an entity handler for User records. Each handler provides methods like `list()`, `create()`, `update()`, and `delete()`.
468+
*
469+
* You don't need to instantiate or import entity handlers. They're automatically available for every entity you create in your app.
470+
*
463471
* ## Built-in User Entity
464472
*
465473
* Every app includes a built-in `User` entity that stores user account information. This entity has special security rules that can't be changed.

src/modules/functions.types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export type FunctionName = keyof FunctionNameRegistry extends never
2222
*
2323
* This module allows you to invoke the custom backend functions defined in the app.
2424
*
25+
* ## Authentication Modes
26+
*
2527
* This module is available to use with a client in all authentication modes:
2628
*
2729
* - **Anonymous or User authentication** (`base44.functions`): Functions are invoked with the current user's permissions. Anonymous users invoke functions without authentication, while authenticated users invoke functions with their authentication context.

0 commit comments

Comments
 (0)