Skip to content

Add docs for SDK#129

Merged
arjunkomath merged 2 commits intodevelopfrom
docs/sdks
Dec 21, 2025
Merged

Add docs for SDK#129
arjunkomath merged 2 commits intodevelopfrom
docs/sdks

Conversation

@arjunkomath
Copy link
Copy Markdown
Member

@arjunkomath arjunkomath commented Dec 21, 2025

Summary by CodeRabbit

  • Documentation

    • Added comprehensive SDK documentation covering Core JavaScript/TypeScript SDK, React SDK, and Next.js integration patterns (App Router and Pages Router) with usage examples.
    • Reorganized getting started page with consolidated quick-start options.
  • Chores

    • Updated React SDK to version 0.4.0 with pinned Core dependency.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
changes-page-docs Ready Ready Preview Dec 21, 2025 3:42am
2 Skipped Deployments
Project Deployment Review Updated (UTC)
changes-page Skipped Skipped Dec 21, 2025 3:42am
user-changes-page Skipped Skipped Dec 21, 2025 3:42am

@vercel vercel bot temporarily deployed to Preview – user-changes-page December 21, 2025 02:24 Inactive
@vercel vercel bot temporarily deployed to Preview – changes-page December 21, 2025 02:24 Inactive
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR expands SDK documentation by adding comprehensive guides for the core and React SDKs, creating a dedicated SDK section with integration examples for Next.js App and Pages routers. The main documentation index is restructured, and the React SDK package version is bumped to 0.4.0 with a pinned dependency on @changespage/core.

Changes

Cohort / File(s) Summary
Documentation reorganization
apps/docs/content/docs/index.mdx
Restructures landing page cards into a single Cards container grouping Setup Widget, SDKs, and API Reference.
New SDK documentation
apps/docs/content/docs/sdk/index.mdx, apps/docs/content/docs/sdk/core.mdx, apps/docs/content/docs/sdk/react.mdx
Adds SDK index page and separate documentation for the framework-agnostic Core SDK and React SDK, including installation, usage examples, API references, and configuration details.
Next.js integration guides
apps/docs/content/docs/sdk/nextjs-app-router.mdx, apps/docs/content/docs/sdk/nextjs-pages-router.mdx
Introduces documentation for using the Changes Page React SDK with Next.js App Router and Pages Router, covering SSR, SSG, client-only patterns, and Tailwind CSS styling examples.
Package metadata update
packages/react-sdk/package.json
Bumps version from 0.3.0 to 0.4.0 and pins @changespage/core dependency to fixed version 0.2.0 (previously workspace:\*).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify documentation accuracy for SDK API signatures and examples
  • Confirm all code samples are syntactically correct and reflect the actual SDK capabilities
  • Validate internal doc links resolve properly (e.g., /docs/sdk/core, /docs/sdk/react)

Possibly related PRs

  • Separate React and Core SDK #126: Implements the core and React SDK split with related export/type moves that directly align with the SDK documentation introduced in this PR.

Poem

🐰 A warren of docs now stands so bright,
SDKs documented left and right,
Core, React, and Next.js in sight,
Organized cards in perfect delight,
Hop along, developers—clarity's quite light!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add docs for SDK' accurately reflects the main objective of this PR, which adds comprehensive SDK documentation across multiple files including core, React, and Next.js integration guides.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d81dd8 and 0a111bc.

📒 Files selected for processing (1)
  • apps/docs/content/docs/sdk/nextjs-pages-router.mdx (1 hunks)

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3b8604 and 4541d7c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • apps/docs/content/docs/index.mdx (1 hunks)
  • apps/docs/content/docs/sdk/core.mdx (1 hunks)
  • apps/docs/content/docs/sdk/index.mdx (1 hunks)
  • apps/docs/content/docs/sdk/nextjs-app-router.mdx (1 hunks)
  • apps/docs/content/docs/sdk/nextjs-pages-router.mdx (1 hunks)
  • apps/docs/content/docs/sdk/react.mdx (1 hunks)
  • packages/react-sdk/package.json (2 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/docs/content/docs/sdk/core.mdx

[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ost or null. #### getPinnedPost() Returns the pinned post or null. ### `getTag...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (15)
apps/docs/content/docs/index.mdx (1)

6-12: LGTM! Clean consolidation of navigation.

The restructured landing page with the unified Cards component provides a cleaner, more maintainable navigation structure. The addition of the SDKs card aligns well with the comprehensive SDK documentation being added in this PR.

packages/react-sdk/package.json (1)

3-3: LGTM! Version bump aligns with SDK documentation.

The minor version bump to 0.4.0 appropriately reflects the SDK enhancements documented in this PR.

apps/docs/content/docs/sdk/index.mdx (1)

1-18: LGTM! Well-structured SDK overview.

The SDK index page provides a clear, logical navigation structure that separates core SDKs from framework-specific examples.

apps/docs/content/docs/sdk/react.mdx (3)

48-70: LGTM! Clear API documentation.

The API reference for usePosts is comprehensive and well-structured, with clear descriptions of options and return values.


71-85: Verify property name in ChangelogPost render prop.

The render prop example on line 77 references plainText, which should be consistent with the actual property name used throughout the SDK. Cross-reference with the API implementation to ensure accuracy.


14-46: No action needed. The documentation correctly uses plainText as the render prop name. The SDK's ChangelogPost component intentionally transforms the API's plain_text_content property to the camelCase plainText prop, which is documented accurately in the example.

apps/docs/content/docs/sdk/core.mdx (2)

6-26: LGTM! Clear installation and usage guide.

The installation steps and usage example effectively demonstrate the core SDK's main methods, providing a solid foundation for developers.


28-60: LGTM! Comprehensive API reference.

The API documentation clearly describes all client methods, options, and return values. The consistent "Returns" phrasing in the method descriptions (lines 53, 57) maintains clarity in technical documentation despite the style hint.

apps/docs/content/docs/sdk/nextjs-app-router.mdx (3)

12-66: LGTM! Proper App Router pattern with SSR.

The example correctly demonstrates Next.js App Router patterns with server-side data fetching and client-side hydration. The TypeScript typing with Awaited<ReturnType<...>> is a nice touch for type safety.


68-108: LGTM! Clean client-only implementation.

The client-only example properly handles initial loading state and provides a good user experience with disabled button states during pagination.


110-174: LGTM! Polished Tailwind implementation.

The Tailwind CSS example provides a production-ready implementation with comprehensive tag styling, a nice loading spinner, and proper responsive design. The tag color mapping covers all PostTag values appropriately.

apps/docs/content/docs/sdk/nextjs-pages-router.mdx (4)

12-57: LGTM! Correct SSR implementation.

The SSR example follows Next.js Pages Router conventions correctly, with proper TypeScript typing using InferGetServerSidePropsType.


59-107: LGTM! SSG with ISR properly configured.

The SSG example demonstrates Incremental Static Regeneration with a 60-second revalidation window, which is a practical pattern for changelog data.


109-147: LGTM! Straightforward client-side implementation.

The client-only example provides a clean implementation that handles loading states appropriately.


149-211: LGTM! Consistent Tailwind styling.

The Tailwind CSS example maintains consistency with the App Router version, providing a cohesive styling pattern across both Next.js routing approaches.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (3)
apps/docs/content/docs/sdk/core.mdx (3)

14-26: Consider adding error handling guidance.

The usage example demonstrates the happy path well, but documenting error handling would help users implement robust integrations.

💡 Enhanced example with error handling
 import { createChangesPageClient } from "@changespage/core";
 
 const client = createChangesPageClient({
   baseUrl: "https://your-page.changes.page",
 });
 
+try {
   const { posts, totalCount, hasMore } = await client.getPosts({ limit: 10 });
-
   const latestPost = await client.getLatestPost();
-
   const pinnedPost = await client.getPinnedPost();
+} catch (error) {
+  console.error("Failed to fetch changelog data:", error);
+}

40-49: Consider documenting the Post structure.

Users would benefit from knowing what fields are available in the returned posts array. Consider adding a subsection documenting the Post interface/type structure.

Example addition:

**Returns:**

An object with:
- `posts`: Array of post objects (each containing `id`, `title`, `content`, `publishedAt`, etc.)
- `totalCount`: Total number of posts available
- `hasMore`: Boolean indicating if more posts exist beyond current offset

51-57: Optional: Vary sentence structure for readability.

The static analysis tool flagged repetitive sentence structure (three sentences starting with "Returns"). While the documentation is clear, varying the wording slightly could improve readability.

Example alternatives:

#### `getLatestPost()`

Retrieves the most recent post or `null` if none exist.

#### `getPinnedPost()`

Returns the pinned post or `null` if none is pinned.

Based on static analysis hints from LanguageTool.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4541d7c and 2d81dd8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • apps/docs/content/docs/sdk/core.mdx (1 hunks)
  • apps/docs/content/docs/sdk/nextjs-app-router.mdx (1 hunks)
  • apps/docs/content/docs/sdk/nextjs-pages-router.mdx (1 hunks)
  • apps/docs/content/docs/sdk/react.mdx (1 hunks)
  • apps/docs/mdx-components.tsx (1 hunks)
  • apps/docs/package.json (1 hunks)
  • apps/docs/source.config.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/docs/content/docs/sdk/nextjs-pages-router.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/docs/content/docs/sdk/react.mdx
  • apps/docs/content/docs/sdk/nextjs-app-router.mdx
🧰 Additional context used
🪛 LanguageTool
apps/docs/content/docs/sdk/core.mdx

[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ost or null. #### getPinnedPost() Returns the pinned post or null. ### `getTag...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (3)
apps/docs/content/docs/sdk/core.mdx (1)

1-10: LGTM!

The frontmatter and installation section are well-structured and provide clear initial guidance.

apps/docs/mdx-components.tsx (1)

1-12: LGTM! Clean integration of Tab and Tabs components.

The import and registration of Tab/Tabs components into the MDX components mapping is correct. The spreading order properly allows consumers to override these components if needed.

apps/docs/source.config.ts (1)

7-20: LGTM! Standard remarkInstall plugin configuration.

The remarkInstall plugin is correctly imported and configured with package manager persistence, which will enable users to see installation commands for their preferred package manager (npm/yarn/pnpm) across the documentation.

@vercel vercel bot temporarily deployed to Preview – user-changes-page December 21, 2025 03:41 Inactive
@vercel vercel bot temporarily deployed to Preview – changes-page December 21, 2025 03:41 Inactive
@arjunkomath arjunkomath merged commit d847347 into develop Dec 21, 2025
6 of 7 checks passed
@arjunkomath arjunkomath deleted the docs/sdks branch December 21, 2025 04:05
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.

1 participant