From c20be61bf0d64931184aa139f50d8c607a2384a7 Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Tue, 3 Mar 2026 10:57:13 +0200 Subject: [PATCH 1/9] Add missing connector types and improve SDK docs - Add slackbot, discord, googlebigquery, and github to connectors JSDoc with available connectors table and Slack User vs Bot explanation - Expose ConnectorIntegrationType and ConnectorIntegrationTypeRegistry in generated docs via types-to-expose and appended-articles config - Group connector types under Type Definitions in post-processing - Fix copy-to-local-docs to support dropdowns navigation format - Remove SSO from loginWithProvider docs (not ready for public docs) - Switch auth provider list separators from hyphens to colons Made-with: Cursor --- .claude/skills/sdk-docs-writing/SKILL.md | 4 ++ .../appended-articles.json | 4 ++ .../copy-to-local-docs.js | 13 ++-- .../file-processing/file-processing.js | 5 ++ .../types-to-expose.json | 2 + src/modules/auth.types.ts | 16 ++--- src/modules/connectors.types.ts | 68 +++++++++++++++++-- 7 files changed, 88 insertions(+), 24 deletions(-) diff --git a/.claude/skills/sdk-docs-writing/SKILL.md b/.claude/skills/sdk-docs-writing/SKILL.md index 7a50564..ea09b5d 100644 --- a/.claude/skills/sdk-docs-writing/SKILL.md +++ b/.claude/skills/sdk-docs-writing/SKILL.md @@ -196,6 +196,10 @@ mint dev When adding a new public type, add it to `types-to-expose.json`. When a helper type should live inside another page, add it to `appended-articles.json`. +## Review checklist for multi-page changes + +When a docs task touches three or more pages in `mintlify-docs` (including pages regenerated by `create-docs-local`), create a `REVIEW-CHECKLIST.md` file in the mintlify-docs repo root listing every affected page with its URL path and what to verify. Split the list into intentional changes and side-effect changes from regeneration. Add a reminder to delete the file before committing. Tell the user the checklist exists so they can work through it at their own pace. + ## Checklist before submitting a PR 1. **JSDoc completeness:** Every public method has description, `@param`, `@returns`, and `@example`. diff --git a/scripts/mintlify-post-processing/appended-articles.json b/scripts/mintlify-post-processing/appended-articles.json index cb83dff..72a82d6 100644 --- a/scripts/mintlify-post-processing/appended-articles.json +++ b/scripts/mintlify-post-processing/appended-articles.json @@ -1,4 +1,8 @@ { + "interfaces/ConnectorsModule": [ + "type-aliases/ConnectorIntegrationType", + "interfaces/ConnectorIntegrationTypeRegistry" + ], "type-aliases/EntitiesModule": [ "interfaces/EntityHandler", "type-aliases/EntityRecord", diff --git a/scripts/mintlify-post-processing/copy-to-local-docs.js b/scripts/mintlify-post-processing/copy-to-local-docs.js index a525159..6e6b87f 100644 --- a/scripts/mintlify-post-processing/copy-to-local-docs.js +++ b/scripts/mintlify-post-processing/copy-to-local-docs.js @@ -160,7 +160,8 @@ function updateDocsJson(repoDir, sdkFiles) { `SDK Reference pages: ${JSON.stringify(sdkReferencePages, null, 2)}` ); - // Navigate to: Developers tab -> anchors -> SDK anchor -> groups -> SDK Reference + // Navigate to: Developers tab -> SDK section -> groups -> SDK Reference + // Supports both legacy "anchors" format and current "dropdowns" format. const developersTab = docs.navigation.tabs.find( (tab) => tab.tab === "Developers" ); @@ -170,13 +171,13 @@ function updateDocsJson(repoDir, sdkFiles) { process.exit(1); } - // Find the SDK anchor - const sdkAnchor = developersTab.anchors?.find( - (anchor) => anchor.anchor === "SDK" - ); + // Find the SDK section (try dropdowns first, then fall back to anchors) + const sdkAnchor = + developersTab.dropdowns?.find((d) => d.dropdown === "SDK") ?? + developersTab.anchors?.find((a) => a.anchor === "SDK"); if (!sdkAnchor) { - console.error("Could not find 'SDK' anchor in Developers tab"); + console.error("Could not find 'SDK' dropdown or anchor in Developers tab"); process.exit(1); } diff --git a/scripts/mintlify-post-processing/file-processing/file-processing.js b/scripts/mintlify-post-processing/file-processing/file-processing.js index 3258237..ec69aeb 100755 --- a/scripts/mintlify-post-processing/file-processing/file-processing.js +++ b/scripts/mintlify-post-processing/file-processing/file-processing.js @@ -1286,6 +1286,11 @@ function groupTypeDefinitions(content) { // Define type definition patterns for different modules const typeGroups = [ + // Connectors module + { + types: ["ConnectorIntegrationType", "ConnectorIntegrationTypeRegistry"], + indicator: "ConnectorIntegrationType" + }, // Entities module { types: ["EntityRecord", "EntityTypeRegistry", "SortField"], diff --git a/scripts/mintlify-post-processing/types-to-expose.json b/scripts/mintlify-post-processing/types-to-expose.json index 20229cf..380ba19 100644 --- a/scripts/mintlify-post-processing/types-to-expose.json +++ b/scripts/mintlify-post-processing/types-to-expose.json @@ -5,6 +5,8 @@ "AnalyticsModule", "AppLogsModule", "AuthModule", + "ConnectorIntegrationType", + "ConnectorIntegrationTypeRegistry", "ConnectorsModule", "CustomIntegrationsModule", "DeleteManyResult", diff --git a/src/modules/auth.types.ts b/src/modules/auth.types.ts index d2b57b2..a66e557 100644 --- a/src/modules/auth.types.ts +++ b/src/modules/auth.types.ts @@ -195,13 +195,12 @@ export interface AuthModule { * Initiates an OAuth login flow with one of the built-in providers. Requires a browser environment and can't be used in the backend. * * Supported providers: - * - `'google'` - {@link https://developers.google.com/identity/protocols/oauth2 | Google OAuth}. Enabled by default. - * - `'microsoft'` - {@link https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow | Microsoft OAuth}. Enable Microsoft in your app's authentication settings before specifying this provider. - * - `'facebook'` - {@link https://developers.facebook.com/docs/facebook-login | Facebook Login}. Enable Facebook in your app's authentication settings before using. - * - `'apple'` - {@link https://developer.apple.com/sign-in-with-apple/ | Sign in with Apple}. Enable Apple in your app's authentication settings before using this provider. - * - `'sso'` - Enterprise SSO. Enable SSO in your app's authentication settings before using this provider. + * - `'google'`: {@link https://developers.google.com/identity/protocols/oauth2 | Google OAuth}. Enabled by default. + * - `'microsoft'`: {@link https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow | Microsoft OAuth}. Enable Microsoft in your app's authentication settings before specifying this provider. + * - `'facebook'`: {@link https://developers.facebook.com/docs/facebook-login | Facebook Login}. Enable Facebook in your app's authentication settings before using. + * - `'apple'`: {@link https://developer.apple.com/sign-in-with-apple/ | Sign in with Apple}. Enable Apple in your app's authentication settings before using this provider. * - * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, `'apple'`, or `'sso'`. + * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, or `'apple'`. * @param fromUrl - URL to redirect to after successful authentication. Defaults to `'/'`. * * @example @@ -222,11 +221,6 @@ export interface AuthModule { * base44.auth.loginWithProvider('apple', '/dashboard'); * ``` * - * @example - * ```typescript - * // SSO - * base44.auth.loginWithProvider('sso', '/dashboard'); - * ``` */ loginWithProvider(provider: string, fromUrl?: string): void; diff --git a/src/modules/connectors.types.ts b/src/modules/connectors.types.ts index 9360f3d..5cb0c42 100644 --- a/src/modules/connectors.types.ts +++ b/src/modules/connectors.types.ts @@ -14,9 +14,10 @@ export interface ConnectorIntegrationTypeRegistry {} * const token = connection.accessToken; * ``` */ -export type ConnectorIntegrationType = keyof ConnectorIntegrationTypeRegistry extends never - ? string - : keyof ConnectorIntegrationTypeRegistry; +export type ConnectorIntegrationType = + keyof ConnectorIntegrationTypeRegistry extends never + ? string + : keyof ConnectorIntegrationTypeRegistry; /** * Response from the connectors access token endpoint. @@ -40,13 +41,43 @@ export interface ConnectorConnectionResponse { /** * Connectors module for managing OAuth tokens for external services. * - * This module allows you to retrieve OAuth access tokens for external services that the app has connected to. Connectors are app-scoped. When an app builder connects an integration like Google Calendar or Slack, all users of the app share that same connection. + * This module allows you to retrieve OAuth access tokens for external services that the app has connected to. Connectors are app-scoped. When an app builder connects an integration like Google Calendar, Slack, or GitHub, all users of the app share that same connection. * * Unlike the integrations module that provides pre-built functions, connectors give you * raw OAuth tokens so you can call external service APIs directly with full control over * the API calls you make. This is useful when you need custom API interactions that aren't * covered by Base44's pre-built integrations. * + * ## Available connectors + * + * All connectors work through [`getAccessToken()`](#getaccesstoken). Pass the integration type string and use the returned OAuth token to call the external service's API directly. + * + * | Service | Type identifier | + * |---|---| + * | Discord | `discord` | + * | GitHub | `github` | + * | Gmail | `gmail` | + * | Google BigQuery | `googlebigquery` | + * | Google Calendar | `googlecalendar` | + * | Google Docs | `googledocs` | + * | Google Drive | `googledrive` | + * | Google Sheets | `googlesheets` | + * | Google Slides | `googleslides` | + * | HubSpot | `hubspot` | + * | LinkedIn | `linkedin` | + * | Notion | `notion` | + * | Salesforce | `salesforce` | + * | Slack User | `slack` | + * | Slack Bot | `slackbot` | + * | TikTok | `tiktok` | + * + * ### Slack User vs Slack Bot + * + * Base44 provides two separate Slack connectors with different OAuth flows: + * + * - **`slack`** (Slack User): Uses a user token. API calls act as the connected Slack user. Requests user-level scopes such as reading conversations and searching message history. Some organizations restrict user-scope Slack apps. + * - **`slackbot`** (Slack Bot): Uses a bot token. API calls act as a bot with a customizable display name and icon. Requests bot-level scopes, which are more commonly allowed by organizations with stricter security policies. The bot can post to public channels without being invited and supports custom branding per message. + * * ## Authentication Modes * * 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. @@ -65,7 +96,7 @@ export interface ConnectorsModule { * has connected to. This token represents the connected app builder's account * and can be used to make authenticated API calls to that external service on behalf of the app. * - * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, or `'github'`. + * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, `'slackbot'`, `'github'`, or `'discord'`. * @returns Promise resolving to the access token string. * * @example @@ -87,8 +118,8 @@ export interface ConnectorsModule { * * @example * ```typescript - * // Slack connection - * // Get Slack OAuth token and list channels + * // Slack User connection + * // Get Slack user token and list channels * const slackToken = await base44.asServiceRole.connectors.getAccessToken('slack'); * * // List all public and private channels @@ -100,6 +131,29 @@ export interface ConnectorsModule { * * const data = await slackResponse.json(); * ``` + * + * @example + * ```typescript + * // Slack Bot connection + * // Get Slack bot token and post a message with a custom bot identity + * const botToken = await base44.asServiceRole.connectors.getAccessToken('slackbot'); + * + * const response = await fetch('https://slack.com/api/chat.postMessage', { + * method: 'POST', + * headers: { + * 'Authorization': `Bearer ${botToken}`, + * 'Content-Type': 'application/json' + * }, + * body: JSON.stringify({ + * channel: '#alerts', + * text: 'Deployment to production completed successfully.', + * username: 'Deploy Bot', + * icon_emoji: ':rocket:' + * }) + * }); + * + * const result = await response.json(); + * ``` */ getAccessToken(integrationType: ConnectorIntegrationType): Promise; From dd05304178257637a7d3312f5e9771619d1f6c08 Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Tue, 3 Mar 2026 11:25:33 +0200 Subject: [PATCH 2/9] Add links to Available connectors in getAccessToken docs Made-with: Cursor --- src/modules/connectors.types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/connectors.types.ts b/src/modules/connectors.types.ts index 5cb0c42..6ce7711 100644 --- a/src/modules/connectors.types.ts +++ b/src/modules/connectors.types.ts @@ -88,7 +88,7 @@ export interface ConnectorConnectionResponse { */ export interface ConnectorsModule { /** - * Retrieves an OAuth access token for a specific external integration type. + * Retrieves an OAuth access token for a specific [external integration type](#available-connectors). * * @deprecated Use {@link getConnection} and use the returned `accessToken` (and `connectionConfig` when needed) instead. * @@ -96,7 +96,7 @@ export interface ConnectorsModule { * has connected to. This token represents the connected app builder's account * and can be used to make authenticated API calls to that external service on behalf of the app. * - * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, `'slackbot'`, `'github'`, or `'discord'`. + * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, `'slackbot'`, `'github'`, or `'discord'`. See [Available connectors](#available-connectors) for the full list. * @returns Promise resolving to the access token string. * * @example From 144e516ab78e8f0281838851379e10d67ac73e3e Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Tue, 3 Mar 2026 13:21:14 +0200 Subject: [PATCH 3/9] Trim Slack section and add connector guide links in JSDoc - Shorten Slack User vs Bot explanation to concise summary - Add links to dedicated connector guides (Gmail, LinkedIn, Slack) Made-with: Cursor --- src/modules/connectors.types.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/connectors.types.ts b/src/modules/connectors.types.ts index 6ce7711..9fe2bc5 100644 --- a/src/modules/connectors.types.ts +++ b/src/modules/connectors.types.ts @@ -71,12 +71,11 @@ export interface ConnectorConnectionResponse { * | Slack Bot | `slackbot` | * | TikTok | `tiktok` | * - * ### Slack User vs Slack Bot + * Some connectors have dedicated setup guides: {@link https://docs.base44.com/Integrations/gmail-connector | Gmail}, {@link https://docs.base44.com/Integrations/linkedin-connector | LinkedIn}, and {@link https://docs.base44.com/Integrations/slack-connector | Slack} (covers both `slack` and `slackbot`). * - * Base44 provides two separate Slack connectors with different OAuth flows: + * ### Slack User vs Slack Bot * - * - **`slack`** (Slack User): Uses a user token. API calls act as the connected Slack user. Requests user-level scopes such as reading conversations and searching message history. Some organizations restrict user-scope Slack apps. - * - **`slackbot`** (Slack Bot): Uses a bot token. API calls act as a bot with a customizable display name and icon. Requests bot-level scopes, which are more commonly allowed by organizations with stricter security policies. The bot can post to public channels without being invited and supports custom branding per message. + * Base44 provides two Slack connectors: `slack` uses a user token and acts as the connected user, while `slackbot` uses a bot token with a customizable display name. Use `slack` when your app needs to read Slack data or act with a user's permissions. Use `slackbot` for sending automated messages as a branded bot. See the {@link https://docs.base44.com/Integrations/slack-connector | Slack connectors} guide for full details. * * ## Authentication Modes * From 165355e0819ac70067abc93d3189e93536b6ac68 Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Tue, 3 Mar 2026 13:25:16 +0200 Subject: [PATCH 4/9] Restore SSO provider and trim Slack section in JSDoc - Add SSO back to loginWithProvider supported providers list and examples - Shorten Slack User vs Bot explanation and add connector guide links Made-with: Cursor --- src/modules/auth.types.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/auth.types.ts b/src/modules/auth.types.ts index a66e557..b7815f4 100644 --- a/src/modules/auth.types.ts +++ b/src/modules/auth.types.ts @@ -199,8 +199,9 @@ export interface AuthModule { * - `'microsoft'`: {@link https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow | Microsoft OAuth}. Enable Microsoft in your app's authentication settings before specifying this provider. * - `'facebook'`: {@link https://developers.facebook.com/docs/facebook-login | Facebook Login}. Enable Facebook in your app's authentication settings before using. * - `'apple'`: {@link https://developer.apple.com/sign-in-with-apple/ | Sign in with Apple}. Enable Apple in your app's authentication settings before using this provider. + * - `'sso'`: Enterprise SSO. Enable SSO in your app's authentication settings before using this provider. * - * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, or `'apple'`. + * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, `'apple'`, or `'sso'`. * @param fromUrl - URL to redirect to after successful authentication. Defaults to `'/'`. * * @example @@ -221,6 +222,12 @@ export interface AuthModule { * base44.auth.loginWithProvider('apple', '/dashboard'); * ``` * + * @example + * ```typescript + * // SSO + * base44.auth.loginWithProvider('sso', '/dashboard'); + * ``` + * */ loginWithProvider(provider: string, fromUrl?: string): void; From 8d6e039615564ca7810540ae3911293d0b19b9f3 Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Tue, 3 Mar 2026 13:46:11 +0200 Subject: [PATCH 5/9] Remove Slack section, link scopes references, add SSO setup link - Remove Slack User vs Bot section (linked elsewhere) - Change connector guide links to point directly to scopes sections - Add link to SSO setup guide in loginWithProvider docs Made-with: Cursor --- src/modules/auth.types.ts | 2 +- src/modules/connectors.types.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modules/auth.types.ts b/src/modules/auth.types.ts index b7815f4..eff2621 100644 --- a/src/modules/auth.types.ts +++ b/src/modules/auth.types.ts @@ -199,7 +199,7 @@ export interface AuthModule { * - `'microsoft'`: {@link https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow | Microsoft OAuth}. Enable Microsoft in your app's authentication settings before specifying this provider. * - `'facebook'`: {@link https://developers.facebook.com/docs/facebook-login | Facebook Login}. Enable Facebook in your app's authentication settings before using. * - `'apple'`: {@link https://developer.apple.com/sign-in-with-apple/ | Sign in with Apple}. Enable Apple in your app's authentication settings before using this provider. - * - `'sso'`: Enterprise SSO. Enable SSO in your app's authentication settings before using this provider. + * - `'sso'`: Enterprise SSO. {@link https://docs.base44.com/Setting-up-your-app/Setting-up-SSO | Set up an SSO provider} in your app's authentication settings before using this provider. * * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, `'apple'`, or `'sso'`. * @param fromUrl - URL to redirect to after successful authentication. Defaults to `'/'`. diff --git a/src/modules/connectors.types.ts b/src/modules/connectors.types.ts index 9fe2bc5..05465b0 100644 --- a/src/modules/connectors.types.ts +++ b/src/modules/connectors.types.ts @@ -71,11 +71,7 @@ export interface ConnectorConnectionResponse { * | Slack Bot | `slackbot` | * | TikTok | `tiktok` | * - * Some connectors have dedicated setup guides: {@link https://docs.base44.com/Integrations/gmail-connector | Gmail}, {@link https://docs.base44.com/Integrations/linkedin-connector | LinkedIn}, and {@link https://docs.base44.com/Integrations/slack-connector | Slack} (covers both `slack` and `slackbot`). - * - * ### Slack User vs Slack Bot - * - * Base44 provides two Slack connectors: `slack` uses a user token and acts as the connected user, while `slackbot` uses a bot token with a customizable display name. Use `slack` when your app needs to read Slack data or act with a user's permissions. Use `slackbot` for sending automated messages as a branded bot. See the {@link https://docs.base44.com/Integrations/slack-connector | Slack connectors} guide for full details. + * For available scopes, see the permissions reference for each service: {@link https://docs.base44.com/Integrations/gmail-connector#gmail-scopes-and-permissions | Gmail}, {@link https://docs.base44.com/Integrations/linkedin-connector#linkedin-scopes-and-permissions | LinkedIn}, {@link https://docs.base44.com/Integrations/slack-connector#slack-scopes-and-permissions | Slack}. * * ## Authentication Modes * From ef1b00971bf33f51b497dceef8b61c3c008cea6f Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Tue, 3 Mar 2026 13:50:55 +0200 Subject: [PATCH 6/9] Add direct link to Slack User vs Bot explanation Made-with: Cursor --- src/modules/connectors.types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/connectors.types.ts b/src/modules/connectors.types.ts index 05465b0..722e101 100644 --- a/src/modules/connectors.types.ts +++ b/src/modules/connectors.types.ts @@ -71,7 +71,7 @@ export interface ConnectorConnectionResponse { * | Slack Bot | `slackbot` | * | TikTok | `tiktok` | * - * For available scopes, see the permissions reference for each service: {@link https://docs.base44.com/Integrations/gmail-connector#gmail-scopes-and-permissions | Gmail}, {@link https://docs.base44.com/Integrations/linkedin-connector#linkedin-scopes-and-permissions | LinkedIn}, {@link https://docs.base44.com/Integrations/slack-connector#slack-scopes-and-permissions | Slack}. + * For available scopes, see the permissions reference for each service: {@link https://docs.base44.com/Integrations/gmail-connector#gmail-scopes-and-permissions | Gmail}, {@link https://docs.base44.com/Integrations/linkedin-connector#linkedin-scopes-and-permissions | LinkedIn}, {@link https://docs.base44.com/Integrations/slack-connector#slack-scopes-and-permissions | Slack}. For an explanation of the difference between `slack` and `slackbot`, see {@link https://docs.base44.com/Integrations/slack-connector#about-the-slack-connectors | About the Slack connectors}. * * ## Authentication Modes * From 13837d8c07ff303c860baeb708c56c0cc8795552 Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Tue, 3 Mar 2026 13:59:57 +0200 Subject: [PATCH 7/9] Format connector guide links as a bulleted list in JSDoc Made-with: Cursor --- src/modules/connectors.types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/connectors.types.ts b/src/modules/connectors.types.ts index 722e101..d67fa67 100644 --- a/src/modules/connectors.types.ts +++ b/src/modules/connectors.types.ts @@ -71,7 +71,10 @@ export interface ConnectorConnectionResponse { * | Slack Bot | `slackbot` | * | TikTok | `tiktok` | * - * For available scopes, see the permissions reference for each service: {@link https://docs.base44.com/Integrations/gmail-connector#gmail-scopes-and-permissions | Gmail}, {@link https://docs.base44.com/Integrations/linkedin-connector#linkedin-scopes-and-permissions | LinkedIn}, {@link https://docs.base44.com/Integrations/slack-connector#slack-scopes-and-permissions | Slack}. For an explanation of the difference between `slack` and `slackbot`, see {@link https://docs.base44.com/Integrations/slack-connector#about-the-slack-connectors | About the Slack connectors}. + * See the integration guides for more details: + * + * - **Scopes and permissions**: {@link https://docs.base44.com/Integrations/gmail-connector#gmail-scopes-and-permissions | Gmail}, {@link https://docs.base44.com/Integrations/linkedin-connector#linkedin-scopes-and-permissions | LinkedIn}, {@link https://docs.base44.com/Integrations/slack-connector#slack-scopes-and-permissions | Slack} + * - **Slack connector types**: {@link https://docs.base44.com/Integrations/slack-connector#about-the-slack-connectors | About the Slack connectors} explains the difference between `slack` and `slackbot` * * ## Authentication Modes * From 0cd3a7192f3b47f3abc8605206cdf21d70a75cd3 Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Tue, 3 Mar 2026 16:07:40 +0200 Subject: [PATCH 8/9] docs: add getConnection() JSDoc, update deprecated rendering pipeline Update connectors.types.ts with getConnection() examples and description, simplify deprecation message, and add deprecated method post-processing to the doc generation pipeline (emoji in heading, Danger callout above signature). Made-with: Cursor --- .claude/skills/sdk-docs-writing/SKILL.md | 1 + .../file-processing/file-processing.js | 120 ++++++++++++++++++ src/modules/connectors.types.ts | 74 +++++++---- 3 files changed, 171 insertions(+), 24 deletions(-) diff --git a/.claude/skills/sdk-docs-writing/SKILL.md b/.claude/skills/sdk-docs-writing/SKILL.md index ea09b5d..6f067e0 100644 --- a/.claude/skills/sdk-docs-writing/SKILL.md +++ b/.claude/skills/sdk-docs-writing/SKILL.md @@ -174,6 +174,7 @@ const records = await base44.entities.MyEntity.list(); - **Avoid gerunds** in section headings within JSDoc. Prefer imperatives or noun phrases. - **State environment constraints** when a method is browser-only: "Requires a browser environment and can't be used in the backend." - **Document side effects** explicitly (e.g., "automatically sets the token for subsequent requests"). +- **Link method references.** When mentioning another SDK method or module by name in JSDoc prose, always use `{@link}` or `{@linkcode}` to create a cross-reference. Never leave a method name as plain text when a link target exists. ## Doc generation pipeline diff --git a/scripts/mintlify-post-processing/file-processing/file-processing.js b/scripts/mintlify-post-processing/file-processing/file-processing.js index ec69aeb..4589768 100755 --- a/scripts/mintlify-post-processing/file-processing/file-processing.js +++ b/scripts/mintlify-post-processing/file-processing/file-processing.js @@ -1017,6 +1017,123 @@ function applySignatureCleanup(dir) { } } +/** + * Transforms deprecated method sections: + * 1. Removes ~~strikethrough~~ and prepends a warning emoji to the heading + * 2. Extracts the #### Deprecated block, removes it, and re-inserts it as a + * callout between the heading and the signature blockquote + */ +function processDeprecatedMethods(content) { + const lines = content.split("\n"); + let modified = false; + let inFence = false; + + // First pass: find all deprecated sections and collect their info + const deprecatedSections = []; + for (let i = 0; i < lines.length; i++) { + const trimmed = lines[i].trim(); + if (trimmed.startsWith("```")) { + inFence = !inFence; + continue; + } + if (inFence) continue; + + if (trimmed === "#### Deprecated") { + const start = i; + let end = i + 1; + let message = ""; + // The first non-empty line after "#### Deprecated" is the deprecation message. + // Any subsequent lines are description text that TypeDoc misplaced here. + while (end < lines.length) { + const t = lines[end].trim(); + if (t.startsWith("#### ") || t.startsWith("### ") || t.startsWith("## ") || t === "***") break; + if (!message && t) { + message = t; + } + end++; + } + deprecatedSections.push({ start, end, message }); + } + } + + if (deprecatedSections.length === 0) { + return { content, modified: false }; + } + + // Remove deprecated sections bottom-up so indices stay valid + for (let s = deprecatedSections.length - 1; s >= 0; s--) { + const { start, end } = deprecatedSections[s]; + lines.splice(start, end - start); + modified = true; + } + + // Second pass: transform headings and insert Danger callouts + inFence = false; + for (let i = 0; i < lines.length; i++) { + const trimmed = lines[i].trim(); + if (trimmed.startsWith("```")) { + inFence = !inFence; + continue; + } + if (inFence) continue; + + // Match deprecated heading: ### ~~methodName()~~ (TypeDoc wraps deprecated names in ~~) + const headingMatch = trimmed.match(/^###\s+~~(.+?)~~\s*$/); + if (!headingMatch) continue; + + // Remove strikethrough and prepend warning emoji + lines[i] = lines[i].replace( + /^(###\s+)~~(.+?)~~\s*$/, + "$1\u26A0\uFE0F $2" + ); + modified = true; + + // Find the matching deprecated message by method name + const methodName = headingMatch[1].replace(/\(\)$/, ""); + const section = deprecatedSections.find((sec) => + sec.message.toLowerCase().includes(methodName.toLowerCase()) || + deprecatedSections.length === 1 + ) || deprecatedSections.shift(); + + if (!section || !section.message) continue; + + // Insert Danger callout right after the heading (before the signature) + const dangerBlock = [ + "", + "", + `**Deprecated:** ${section.message}`, + "", + "", + ]; + lines.splice(i + 1, 0, ...dangerBlock); + } + + return { content: lines.join("\n"), modified }; +} + +function applyDeprecatedMethodProcessing(dir) { + if (!fs.existsSync(dir)) return; + const entries = fs.readdirSync(dir, { withFileTypes: true }); + for (const entry of entries) { + const entryPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + applyDeprecatedMethodProcessing(entryPath); + } else if ( + entry.isFile() && + (entry.name.endsWith(".mdx") || entry.name.endsWith(".md")) + ) { + const content = fs.readFileSync(entryPath, "utf-8"); + const { content: updated, modified } = processDeprecatedMethods(content); + if (modified) { + fs.writeFileSync(entryPath, updated, "utf-8"); + console.log( + `Processed deprecated methods: ${path.relative(DOCS_DIR, entryPath)}` + ); + } + } + } +} + function demoteNonCallableHeadings(content) { const lines = content.split("\n"); let inFence = false; @@ -1919,6 +2036,9 @@ function main() { // Clean up signatures: fix truncated generics, simplify keyof constraints, break long lines applySignatureCleanup(DOCS_DIR); + // Transform deprecated methods: add badge to heading, move deprecation notice to Warning callout + applyDeprecatedMethodProcessing(DOCS_DIR); + applyHeadingDemotion(DOCS_DIR); // Group intro sections (Built-in User Entity, Generated Types, etc.) under Overview diff --git a/src/modules/connectors.types.ts b/src/modules/connectors.types.ts index d67fa67..252b162 100644 --- a/src/modules/connectors.types.ts +++ b/src/modules/connectors.types.ts @@ -29,7 +29,7 @@ export interface ConnectorAccessTokenResponse { } /** - * Camel-cased connection details returned by {@linkcode ConnectorsModule.getConnection | getConnection()}. + * Connection details. */ export interface ConnectorConnectionResponse { /** The OAuth access token for the external service. */ @@ -50,7 +50,7 @@ export interface ConnectorConnectionResponse { * * ## Available connectors * - * All connectors work through [`getAccessToken()`](#getaccesstoken). Pass the integration type string and use the returned OAuth token to call the external service's API directly. + * All connectors work through [`getConnection()`](#getconnection). Pass the integration type string and use the returned OAuth token to call the external service's API directly. * * | Service | Type identifier | * |---|---| @@ -88,7 +88,7 @@ export interface ConnectorsModule { /** * Retrieves an OAuth access token for a specific [external integration type](#available-connectors). * - * @deprecated Use {@link getConnection} and use the returned `accessToken` (and `connectionConfig` when needed) instead. + * @deprecated Use {@link getConnection} instead. * * Returns the OAuth token string for an external service that an app builder * has connected to. This token represents the connected app builder's account @@ -159,37 +159,63 @@ export interface ConnectorsModule { * Retrieves the OAuth access token and connection configuration for a specific external integration type. * * Returns both the OAuth token and any additional connection configuration - * that the connector provides. This is useful when the external service requires - * extra parameters beyond the access token (e.g., a shop domain, account ID, or API base URL). + * that the connector provides. Some connectors require connection-specific + * parameters to build API requests. For example, a service might need a + * subdomain to construct the API URL (`{subdomain}.example.com`), which + * is available in `connectionConfig`. Most connectors only need the + * `accessToken`; `connectionConfig` will be `null` when there are no + * extra parameters. * * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, or `'github'`. * @returns Promise resolving to a {@link ConnectorConnectionResponse} with `accessToken` and `connectionConfig`. * * @example * ```typescript - * // Basic usage - * const connection = await base44.asServiceRole.connectors.getConnection('googlecalendar'); - * console.log(connection.accessToken); - * console.log(connection.connectionConfig); + * // Google Calendar connection + * // Get Google Calendar OAuth token and fetch upcoming events + * const { accessToken } = await base44.asServiceRole.connectors.getConnection('googlecalendar'); + * + * const timeMin = new Date().toISOString(); + * const url = `https://www.googleapis.com/calendar/v3/calendars/primary/events?maxResults=10&orderBy=startTime&singleEvents=true&timeMin=${timeMin}`; + * + * const calendarResponse = await fetch(url, { + * headers: { Authorization: `Bearer ${accessToken}` } + * }); + * + * const events = await calendarResponse.json(); * ``` * * @example * ```typescript - * // Shopify: connectionConfig has subdomain (e.g. "my-store" for my-store.myshopify.com) - * const connection = await base44.asServiceRole.connectors.getConnection('shopify'); - * const { accessToken, connectionConfig } = connection; - * const shop = connectionConfig?.subdomain - * ? `https://${connectionConfig.subdomain}.myshopify.com` - * : null; - * - * if (shop) { - * const response = await fetch( - * `${shop}/admin/api/2024-01/products.json?limit=10`, - * { headers: { 'X-Shopify-Access-Token': accessToken } } - * ); - * const { products } = await response.json(); - * } + * // Slack connection + * // Get Slack OAuth token and list channels + * const { accessToken } = await base44.asServiceRole.connectors.getConnection('slack'); + * + * const url = 'https://slack.com/api/conversations.list?types=public_channel,private_channel&limit=100'; + * + * const slackResponse = await fetch(url, { + * headers: { Authorization: `Bearer ${accessToken}` } + * }); + * + * const data = await slackResponse.json(); + * ``` + * + * @example + * ```typescript + * // Using connectionConfig + * // Some connectors return a subdomain or other params needed to build the API URL + * const { accessToken, connectionConfig } = await base44.asServiceRole.connectors.getConnection('myservice'); + * + * const subdomain = connectionConfig?.subdomain; + * const response = await fetch( + * `https://${subdomain}.example.com/api/v1/resources`, + * { headers: { Authorization: `Bearer ${accessToken}` } } + * ); + * + * const data = await response.json(); * ``` */ - getConnection(integrationType: ConnectorIntegrationType): Promise; + getConnection( + integrationType: ConnectorIntegrationType, + ): Promise; } From da0b331782dabd91e6fe4e240366259a0173b920 Mon Sep 17 00:00:00 2001 From: Sam Markowitz Date: Thu, 5 Mar 2026 08:47:52 +0200 Subject: [PATCH 9/9] docs: add new connectors, refine getConnection description and param links Add Box, ClickUp, Google Analytics, and Wrike to the available connectors table. Add links to Available connectors in getConnection description and param. Simplify getConnection description into two focused paragraphs. Made-with: Cursor --- src/modules/connectors.types.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/modules/connectors.types.ts b/src/modules/connectors.types.ts index 252b162..d831671 100644 --- a/src/modules/connectors.types.ts +++ b/src/modules/connectors.types.ts @@ -54,9 +54,12 @@ export interface ConnectorConnectionResponse { * * | Service | Type identifier | * |---|---| + * | Box | `box` | + * | ClickUp | `clickup` | * | Discord | `discord` | * | GitHub | `github` | * | Gmail | `gmail` | + * | Google Analytics | `google_analytics` | * | Google BigQuery | `googlebigquery` | * | Google Calendar | `googlecalendar` | * | Google Docs | `googledocs` | @@ -70,6 +73,7 @@ export interface ConnectorConnectionResponse { * | Slack User | `slack` | * | Slack Bot | `slackbot` | * | TikTok | `tiktok` | + * | Wrike | `wrike` | * * See the integration guides for more details: * @@ -156,17 +160,15 @@ export interface ConnectorsModule { getAccessToken(integrationType: ConnectorIntegrationType): Promise; /** - * Retrieves the OAuth access token and connection configuration for a specific external integration type. + * Retrieves the OAuth access token and connection configuration for a specific [external integration type](#available-connectors). * - * Returns both the OAuth token and any additional connection configuration - * that the connector provides. Some connectors require connection-specific - * parameters to build API requests. For example, a service might need a - * subdomain to construct the API URL (`{subdomain}.example.com`), which - * is available in `connectionConfig`. Most connectors only need the - * `accessToken`; `connectionConfig` will be `null` when there are no - * extra parameters. + * Some connectors require connection-specific parameters to build API calls. + * In such cases, the returned `connectionConfig` is an object with the additional parameters. If there are no extra parameters needed for the connection, the `connectionConfig` is `null`. * - * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, or `'github'`. + * For example, a service might need a subdomain to construct the API URL in + * the form of `{subdomain}.example.com`. In such a case the subdomain will be available as a property of the `connectionConfig` object. + * + * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, `'slackbot'`, `'github'`, or `'discord'`. See [Available connectors](#available-connectors) for the full list. * @returns Promise resolving to a {@link ConnectorConnectionResponse} with `accessToken` and `connectionConfig`. * * @example