Skip to content

feat: read docs sdk endpoint - #520

Merged
tonychang04 merged 6 commits into
mainfrom
docs/fixDocsMap
Oct 29, 2025
Merged

tonychang04 merged 6 commits into
mainfrom
docs/fixDocsMap

Conversation

@tonychang04

@tonychang04 tonychang04 commented Oct 24, 2025 •

Copy link
Copy Markdown
Member

Summary

How did you test this change?

Summary by CodeRabbit

  • Documentation
    • Reworked SDK docs into concise API references for AI, Auth, Database, Storage, and Functions; documentation index keys and paths updated to the new SDK-style topics.
  • New Features
    • Installation snippets now pin the latest tag and client examples accept an optional anonKey for unauthenticated/public requests.
    • Backend seed now auto-initializes an ANON_KEY when missing to support anonymous token usage.

@tonychang04
tonychang04 marked this pull request as ready for review October 24, 2025 21:45
@coderabbitai

coderabbitai Bot commented Oct 24, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Updated docs routing keys and file paths to point at new SDK-style MDX docs under docs/core-concepts/*; multiple SDK docs were rewritten as compact API references; backend seed logic now generates and stores an ANON_KEY via AuthService when missing. Core doc retrieval and ENOENT handling remain unchanged.

Changes

Cohort / File(s) Summary
Backend docs route
backend/src/api/routes/docs.ts
Replaced DOCS_MAP keys from API-style to SDK-style (db-sdk, auth-sdk, storage-sdk, functions-sdk, ai-integration-sdk) and updated mapped file paths to new MDX locations under docs/core-concepts/*. Validation and ENOENT handling unchanged.
Backend seed logic
backend/src/utils/seed.ts
Use AuthService.getInstance(); adjust INSFORGE_INTERNAL_URL null check/logging; when ANON_KEY missing call authService.generateAnonToken(), create ANON_KEY secret, and log initialization.
AI SDK doc (reference)
docs/core-concepts/ai/sdk.mdx
Rewritten as AI SDK Reference: formalized chat.completions.create() and images.generate() parameters/returns, separated streaming vs non-streaming shapes, and replaced narrative examples with concise reference examples.
Authentication SDK doc (reference)
docs/core-concepts/authentication/sdk.mdx
Converted to method-centric Authentication SDK Reference with explicit APIs (signUp, signInWithPassword, signInWithOAuth, signOut, getCurrentUser, getCurrentSession, getProfile, setProfile) including params, return shapes, and examples.
Database SDK doc (reference)
docs/core-concepts/database/sdk.mdx
Reorganized to operation-focused reference (insert, select, update, delete, modifiers, pagination) with standardized parameter/return examples; removed older narrative examples.
Functions SDK doc (reference)
docs/core-concepts/functions/sdk.mdx
Streamlined to invoke() usage by slug with Parameters/Returns and example payloads; added note about automatic auth token inclusion and removed lengthy prior examples.
Storage SDK doc (reference)
docs/core-concepts/storage/sdk.mdx
Reframed as Storage SDK Reference introducing from(), upload, download, remove with explicit params/returns and key-handling warning; removed demo components and long guides.
SDK installation snippet
docs/snippets/sdk-installation.mdx
Installation commands pinned to @insforge/sdk@latest; createClient example now shows optional anonKey in config.
Insforge instructions (quick start)
docs/insforge-instructions-sdk.md
Rewritten into a compact, initialization-first quick-start emphasizing critical SDK initialization and linking to new core-concepts docs.
Database architecture note
docs/core-concepts/database/architecture.mdx
Minor wording change: _edge_functions description updated to "Serverless function definitions".

Sequence Diagram(s)

sequenceDiagram
  participant Seed as seedBackend
  participant Secrets as SecretStore
  participant Auth as AuthService

  rect #EFEFEF
    Seed->>Secrets: check INSFORGE_INTERNAL_URL
    alt missing
      Seed->>Secrets: create INSFORGE_INTERNAL_URL secret
    end
  end

  rect #E8F5E9
    Seed->>Secrets: check ANON_KEY
    alt missing
      Seed->>Auth: AuthService.getInstance().generateAnonToken()
      Auth-->>Seed: anonToken
      Seed->>Secrets: create ANON_KEY = anonToken
    else exists
      Secrets-->>Seed: ANON_KEY present
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Heterogeneous changes: one backend docs mapping update, one seed logic change involving AuthService and secrets, and multiple substantial documentation rewrites.
  • Review attention suggestions:
    • backend/src/api/routes/docs.ts — ensure consumers and external references align with new doc keys/paths.
    • backend/src/utils/seed.ts — verify AuthService usage, token generation, and secret creation semantics.
    • Representative docs/core-concepts/*/sdk.mdx files — confirm parameter/return shapes match runtime APIs.

Possibly related PRs

Suggested reviewers

  • Fermionic-Lyu
  • Leo-rq-yu

Poem

🐇 I hopped through maps and docs today,
I swapped the keys and sent old paths away,
MDX pages now tidy, examples short and bright,
Seeds sprouted ANON keys in the moonlight,
🥕 Tiny hops, big docs — a rabbit's delight!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "feat: read docs sdk endpoint" is partially related to the changeset. It appropriately references the backend changes in backend/src/api/routes/docs.ts, where the DOCS_MAP is updated to support new SDK-style documentation keys and paths, effectively enabling the backend to read and serve updated SDK documentation. However, the title does not capture the substantial scope of the PR, which primarily consists of comprehensive rewrites and restructuring of multiple SDK documentation files (authentication, database, storage, AI, and functions) to follow a standardized reference format, along with updates to SDK installation snippets and seed configuration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/fixDocsMap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
docs/core-concepts/database/sdk.mdx (1)

66-68: Minor wording refinement for insert() description.

The phrase "Insert new records" is slightly wordy. Consider: "Insert records into a table."

Apply this diff if desired:

-Insert new records into a table.
+Insert records into a table.
docs/core-concepts/authentication/sdk.mdx (1)

114-122: Capitalize GitHub in OAuth provider documentation.

Line 120 lists the provider as 'github' in the type union, but GitHub's official branding uses a capital "H". Update for consistency with official naming conventions.

Apply this diff:

-- `provider` ('google' | 'github', required) - OAuth provider
+- `provider` ('google' | 'GitHub', required) - OAuth provider

Note: If the actual SDK accepts the lowercase string 'github', keep the code example as-is but consider a note clarifying the string value.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a733b8 and 55e74c6.

📒 Files selected for processing (6)
  • docs/core-concepts/ai/sdk.mdx (1 hunks)
  • docs/core-concepts/authentication/sdk.mdx (2 hunks)
  • docs/core-concepts/database/sdk.mdx (1 hunks)
  • docs/core-concepts/functions/sdk.mdx (1 hunks)
  • docs/core-concepts/storage/sdk.mdx (1 hunks)
  • docs/snippets/sdk-installation.mdx (1 hunks)
🧰 Additional context used
🪛 Gitleaks (8.28.0)
docs/core-concepts/authentication/sdk.mdx

[high] 55-55: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 106-106: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 289-289: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 LanguageTool
docs/core-concepts/database/sdk.mdx

[style] ~68-~68: ‘new records’ might be wordy. Consider a shorter alternative.
Context: ...": null } ``` --- ## insert() Insert new records into a table. ### Parameters - `value...

(EN_WORDINESS_PREMIUM_NEW_RECORDS)

docs/core-concepts/authentication/sdk.mdx

[uncategorized] ~120-~120: The official name of this software platform is spelled with a capital “H”.
Context: ...# Parameters - provider ('google' | 'github', required) - OAuth provider - `redirec...

(GITHUB)

🔇 Additional comments (6)
docs/snippets/sdk-installation.mdx (1)

1-21: SDK installation snippet updates look good.

The explicit @latest tags provide clarity on version intent, and the optional anonKey in the configuration is appropriately documented for public/unauthenticated requests.

docs/core-concepts/functions/sdk.mdx (1)

1-100: Functions SDK reference is well-structured.

The API-reference format with Parameters, Returns, and multiple examples (POST, GET, custom headers) provides clear guidance for invoking edge functions. The Note about automatic authentication token inclusion is helpful context.

docs/core-concepts/database/sdk.mdx (1)

1-120: Database SDK reference is comprehensive and well-organized.

The CRUD operations are clearly documented with Parameters, Returns, and realistic examples. The Warning notes on update/delete filters are appropriate safeguards, and the Filters/Modifiers reference tables provide good lookup capability.

docs/core-concepts/storage/sdk.mdx (1)

1-221: Storage SDK reference is clear and practical.

The distinction between upload() with explicit keys and uploadAuto() with auto-generated keys is well-explained. The Warning note about backend auto-renames and the examples showing integration with database operations (saving URLs) provide valuable context for typical workflows.

docs/core-concepts/ai/sdk.mdx (1)

1-202: AI SDK reference is detailed and practical.

The documentation clearly distinguishes streaming vs non-streaming modes for chat completions, and examples demonstrate realistic workflows (e.g., base64 image handling → storage upload → database insert). The Parameters and Returns schemas are comprehensive.

Note: Gitleaks flags the JWT token examples (lines 55, 106, 289) as generic API keys—these are documentation samples, not real secrets, so the flags are false positives.

docs/core-concepts/authentication/sdk.mdx (1)

1-407: Authentication SDK reference is comprehensive and well-organized.

The documentation clearly separates authentication operations (signUp, signIn, signOut, OAuth) from profile management (getProfile, setProfile). The distinction between getCurrentUser() (includes profile data) and getCurrentSession() (local storage only) is helpful. Error Handling examples provide useful context.

Note: Gitleaks flags JWT tokens in examples (lines 55, 106, 289) as generic API keys—these are documentation samples, not real secrets.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 55e74c6 and a818f63.

📒 Files selected for processing (3)
  • backend/src/utils/seed.ts (3 hunks)
  • docs/core-concepts/functions/sdk.mdx (1 hunks)
  • docs/insforge-instructions-sdk.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/core-concepts/functions/sdk.mdx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use TypeScript for all code files
Use ES modules (import/export syntax)
Prefer descriptive, unabbreviated variable and function names
Implement proper error handling with try-catch blocks and logging where appropriate
Use single quotes for strings
Include semicolons at the end of statements
Use arrow functions for callbacks and inline functions
Prefer const over let; avoid var
Use template literals for string interpolation
Maintain 2-space indentation
Format code with the repository Prettier configuration
Variables, parameters, properties, and functions must use camelCase
Constants and enum members must use UPPER_CASE
Include JSDoc comments for complex functions

Files:

  • backend/src/utils/seed.ts
backend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

backend/src/**/*.{ts,tsx}: Use async/await for asynchronous operations in the backend
Use Zod schemas for request/response validation
Return consistent API responses using utility functions
Validate all user inputs
Sanitize data before database operations
Use prepared statements for SQL queries
Implement proper caching strategies (server-side)

Files:

  • backend/src/utils/seed.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

React components and TypeScript types/interfaces must use PascalCase

Files:

  • backend/src/utils/seed.ts
**/[a-z][a-z0-9-]*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Utility files should use kebab-case or camelCase (kebab-case validated here)

Files:

  • backend/src/utils/seed.ts
🧬 Code graph analysis (1)
backend/src/utils/seed.ts (1)
backend/src/core/auth/auth.ts (1)
  • AuthService (45-1479)
🪛 markdownlint-cli2 (0.18.1)
docs/insforge-instructions-sdk.md

22-22: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: CI Pre-merge Check
  • GitHub Check: E2E Tests
🔇 Additional comments (3)
backend/src/utils/seed.ts (3)

8-8: LGTM! AuthService properly imported and instantiated.

The singleton pattern usage is correct, and the code follows all coding guidelines.

Also applies to: 157-158


200-200: LGTM! Improved variable naming and logging.

The refactoring makes the code more readable by using a descriptive variable name and a specific log message.

Also applies to: 202-202, 208-209


211-223: Verify security implications of never-expiring ANON_KEY.

The implementation follows the established pattern and coding guidelines. However, the generateAnonToken() method creates a JWT that never expires (as shown in backend/src/core/auth/auth.ts lines 91-104).

Please confirm this is intentional for the anonymous edge function access model and that appropriate authorization controls are in place to limit what can be done with this token.

## Initial Setup

## AI Operations
**🚨 CRITICAL: Initialize the SDK Client**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use a heading instead of bold emphasis.

Line 22 uses bold emphasis where a heading is more appropriate. This violates markdown conventions (MD036) and affects document outline structure.

Apply this diff to use a proper heading:

-**🚨 CRITICAL: Initialize the SDK Client**
+### 🚨 CRITICAL: Initialize the SDK Client
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**🚨 CRITICAL: Initialize the SDK Client**
### 🚨 CRITICAL: Initialize the SDK Client
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

22-22: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🤖 Prompt for AI Agents
In docs/insforge-instructions-sdk.md around line 22, the text currently uses
bold emphasis for a section title ("**🚨 CRITICAL: Initialize the SDK
Client**"); replace that bold markup with a proper Markdown heading (e.g.,
prepend one or more # characters as appropriate for the document structure,
e.g., "## 🚨 CRITICAL: Initialize the SDK Client") so the line becomes a heading
and conforms to MD036 and the document outline.

## Complete Example

```javascript
```javascriptn

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix typo in code fence language identifier.

The code fence declares javascriptn instead of javascript, which breaks syntax highlighting.

Apply this diff to fix the typo:

-\`\`\`javascriptn
+\`\`\`javascript
🤖 Prompt for AI Agents
In docs/insforge-instructions-sdk.md around line 26, the code fence language
identifier is misspelled as "javascriptn"; change it to "javascript" so syntax
highlighting works correctly by editing the opening triple-backtick fence to use
"javascript" instead of "javascriptn".

Comment thread docs/core-concepts/ai/sdk.mdx Resolved
### Example

```javascript
const { error } = await insforge.auth.signOut()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does error exist, how to handle it? signOut failed and stay in loggedin?
If signout always successes, the result isn't necessary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://supabase.com/docs/reference/javascript/auth-signout

error can be null which means signout success,. signout just clears the session storage. For Insforge we just clear the local storage. It should be very rare if it fails, but this is just to match the syntax.

Comment thread docs/core-concepts/database/sdk.mdx Resolved
Comment thread docs/core-concepts/functions/sdk.mdx Resolved
Comment thread docs/core-concepts/storage/sdk.mdx Outdated
// Save URL to database
await insforge.database
.from('users')
.update({ avatar_url: data.url })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to download this image throught url, I thought the coming examples should include this case, but actually not.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The download examples are below when talking about sdk downloads

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But they are not download from url, feels the examples are inconsistent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image url is only for display usage right? download is for a different case, are you asking for how image can be displayed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am concerning the download.
As a developer, after reading this doc, I know when I uploaded a image I can save the url to related record.
However I don't know how to find it from this doc since there isn't list or query api.
Imagine the scenario of avatar, If I just connect user with the avatar_url, how to update it and how to download it? We can't explain the whole use case clear.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added additional details feel free to change later if needed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
docs/insforge-instructions-sdk.md (2)

22-22: Use a heading instead of bold emphasis for section title.

Line 22 uses bold text ("🚨 CRITICAL: Initialize the SDK Client") where a proper Markdown heading is more appropriate. This violates MD036 markdown conventions and breaks document outline structure. This issue was flagged in the previous review and needs to be corrected.

-**🚨 CRITICAL: Initialize the SDK Client**
+### 🚨 CRITICAL: Initialize the SDK Client

26-26: Fix typo in code fence language identifier.

The code fence declares javascriptn instead of javascript, which breaks syntax highlighting. This issue was flagged in the previous review and needs to be corrected.

-\`\`\`javascriptn
+\`\`\`javascript
🧹 Nitpick comments (1)
docs/core-concepts/database/sdk.mdx (1)

12-12: Simplify introductory text for insert().

Line 12 uses slightly wordy phrasing. Consider brevity: "Insert records into a table" conveys the same meaning more directly.

-Insert new records into a table.
+Insert records into a table.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a818f63 and 10275b0.

📒 Files selected for processing (5)
  • docs/core-concepts/ai/sdk.mdx (1 hunks)
  • docs/core-concepts/database/architecture.mdx (1 hunks)
  • docs/core-concepts/database/sdk.mdx (1 hunks)
  • docs/core-concepts/functions/sdk.mdx (1 hunks)
  • docs/insforge-instructions-sdk.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/core-concepts/database/architecture.mdx
🧰 Additional context used
🪛 LanguageTool
docs/core-concepts/database/sdk.mdx

[style] ~12-~12: ‘new records’ might be wordy. Consider a shorter alternative.
Context: ... ## insert() Insert new records into a table. ### Parameters - `value...

(EN_WORDINESS_PREMIUM_NEW_RECORDS)

🪛 markdownlint-cli2 (0.18.1)
docs/insforge-instructions-sdk.md

22-22: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🔇 Additional comments (14)
docs/core-concepts/database/sdk.mdx (7)

10-65: Operations ordering and documentation structure are clear.

The insert() operation follows a well-structured format with clear Parameters, Returns, Note, Examples, and Output sections. The .select() chaining hint is helpful for users. The examples correctly show both single and bulk insert patterns.


67-120: Update operation documentation is well-structured and includes protective warnings.

The required filter warning is prominent and appropriate. Examples cover both single and multiple record updates. Return shape matches insert() for consistency.


123-171: Delete operation balances safety with clarity.

The strong warning about requiring filters is well-placed. Example with .lt() demonstrates time-based deletion, which is practical. Null data return is correctly documented.


174-227: Select operation documentation covers key patterns.

Parameters section clearly documents optional column selection, count modes, and head option. The relationships example at line 212 (select('*, users(nickname, avatar_url)')) is valuable for users querying across tables.


230-257: Filters section is comprehensive and well-organized.

The table format with descriptions and examples for each filter operator (eq, neq, gt, gte, lt, lte, like, ilike, in, is) provides quick reference. Chained filter example demonstrates practical usage pattern.


260-281: Modifiers section provides clear query control options.

Documentation of order(), limit(), range(), single(), and maybeSingle() is accurate. Pagination example correctly chains order + range + limit. Parameter syntax for order options (ascending, nullsFirst) is clear.


284-337: Common Patterns section adds practical value with real-world examples.

Pagination example correctly shows count mode and offset calculation. Filtered search example chains multiple filters effectively. Output blocks demonstrate expected response structures, which aids developer understanding.

docs/core-concepts/functions/sdk.mdx (3)

10-32: invoke() API reference is well-structured and accessible.

The Parameters section clearly delineates the required slug parameter from optional configuration (body, headers, method). The Returns section correctly shows the standard {data, error} pattern. The Note about automatic authentication token inclusion is valuable context for users.


34-99: Three-tier example progression effectively demonstrates invoke() usage.

Examples progress logically from POST with body → GET request → custom headers, each with corresponding output blocks. This scaffolded approach helps developers understand different invocation patterns.


101-184: Complete serverless function examples provide essential implementation patterns.

The two examples (public and authenticated) correctly demonstrate:

  • CORS header handling for both
  • Environment variable usage (INSFORGE_INTERNAL_URL, ANON_KEY, edgeFunctionToken)
  • Authentication token extraction from request headers
  • Error handling for unauthorized access
  • Database operations within functions

These patterns give developers concrete templates for their own functions.

docs/core-concepts/ai/sdk.mdx (2)

10-122: chat.completions.create() documentation is comprehensive with both streaming modes.

Parameters clearly document the model directive to call mcp__insforge__get-backend-metadata to get available models (addressing prior review concern about model list discovery). The dual Returns sections (non-streaming and streaming) with TypeScript signatures are helpful. Examples effectively demonstrate non-streaming usage, streaming iteration, and output structure. The AsyncIterableIterator pattern for streaming is correct.


125-202: images.generate() API reference provides clear contract and practical example.

Parameters section covers model, prompt, optional input images, sizing, quality, and style options. Returns schema correctly shows both b64_json and optional content properties. The example at lines 160-183 demonstrates a realistic workflow: generate image → convert base64 → upload to storage → save URL to database. This practical pattern adds developer value beyond API documentation.

docs/insforge-instructions-sdk.md (2)

1-47: Content structure and information architecture are sound.

The overview clearly explains InsForge's core services. The Installation section is concise. The "Getting Detailed Documentation" section with fetch-docs tool mapping is valuable for guiding users to the right references. This initialization-first approach aligns well with the new SDK-reference documentation style across the core-concepts modules.


49-76: SDK vs MCP Tools distinction is clearly explained with practical guidance.

The categorization helps users understand when to use the SDK (application logic: auth, database, storage, AI, functions) versus MCP tools (infrastructure: setup, schema, buckets, deployment). The Quick Start four-step flow provides a clear onboarding path. Important Notes section emphasizes key implementation details like array format for inserts and single endpoint constraint for functions.

@tonychang04
tonychang04 requested a review from jwfing October 28, 2025 05:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/core-concepts/storage/sdk.mdx (1)

1-252: API-reference restructuring is well-executed.

The transition from narrative style to structured Parameters/Returns/Example/Output blocks makes the API surface clear and scannable. All five operations (from, upload, uploadAuto, download, remove) follow consistent formatting. However, verify whether list/query operations are documented elsewhere, since the earlier review mentioned missing list/query APIs for discovering uploaded files.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03c7fd3 and 40fc03b.

📒 Files selected for processing (1)
  • docs/core-concepts/storage/sdk.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: E2E Tests
🔇 Additional comments (2)
docs/core-concepts/storage/sdk.mdx (2)

155-200: Excellent—download workflow now directly addresses previous feedback.

The documentation now provides a complete, practical avatar use case (lines 175-190): retrieve the stored key from your database, download the file, and display it. This directly resolves the concern raised in earlier reviews about the incomplete workflow. The pattern of storing both key and url on upload (lines 68-76, 131-133) and retrieving the key for download/deletion is now explicit and clear.


57-59: Clear guidance on key handling.

The warning about auto-renaming on key collisions is helpful and reinforces why storing the returned key is essential. Combined with the examples showing both url and key being saved to the database, developers now have the right mental model for reliable file management.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants