Skip to content

Offer top built-in integrations in onboarding step 3 - #1347

Merged
kody-bot merged 2 commits into
mainfrom
cursor/onboarding-built-in-providers-c0a2
Aug 9, 2026
Merged

kody-bot merged 2 commits into
mainfrom
cursor/onboarding-built-in-providers-c0a2

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Aug 9, 2026 •

Copy link
Copy Markdown
Owner

What

Onboarding step 3 ("Install a starter package") now opens with a Use a built-in integration callout when the deployment has enabled platform OAuth apps: the top three by user connection count render as one-click connect pills (logo + label) linking to /connect/oauth?provider={slug}, followed by a "Bring your own OAuth app for more power" line for users who want their own scopes and rate limits. The block hides entirely when no platform apps are enabled.

How

  • listTopPlatformAppsByUse in platform-apps.ts: enabled apps ordered by user_integrations connection count (ties by creation order), covered by a unit test that also checks disabled apps are excluded.
  • builtInProviders on the onboarding payload (OnboardingBuiltInProvider: slug, label, logoPath), loaded fail-open in the onboarding handler so a D1 blip or an empty deployment never breaks the page. Anonymous visitors get the list too; unverified logged-in users get the same empty gating as featuredListings.
  • Step 3 panel renders the accent-well callout above the starter grid (data-testid="onboarding-built-in-integrations").

Testing

  • npm run validate green (new ordering test, updated payload fixtures).
  • Verified in the browser against seeded local platform apps (3 enabled + 1 disabled): the block shows GitHub/Google/Notion, hides disabled Slack, and the GitHub pill lands on the prefilled built-in connect page ("no OAuth app setup needed").

Onboarding step 3 with built-in integrations block

onboarding_built_in_integrations_demo.mp4

Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Added a one-click integrations callout to onboarding when built-in providers are available.
    • Providers now include direct OAuth setup links and may display logos.
    • Added a “Bring Your Own OAuth” fallback for custom integrations.
    • Onboarding displays up to three enabled, popular platform providers.
    • BYOK guidance now adapts based on available built-in providers.
  • Bug Fixes

    • Provider information is only shown in authenticated onboarding flows for verified accounts.

The onboarding payload now carries builtInProviders: the top three
enabled platform OAuth apps ordered by user connection count (fails
open to an empty list). Step 3 of the wizard renders them above the
starter package grid as one-click connect pills pointing at
/connect/oauth?provider={slug}, with a bring-your-own-OAuth-app line
for users who want their own scopes and rate limits. The block hides
entirely when no platform apps are enabled.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f9ff8d6-d57f-4377-ac36-f88a970b5410

📥 Commits

Reviewing files that changed from the base of the PR and between 63c2a1d and 2536a3e.

📒 Files selected for processing (2)
  • packages/worker/client/routes/onboarding.tsx
  • packages/worker/src/app/onboarding-data.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/worker/src/app/onboarding-data.ts
  • packages/worker/client/routes/onboarding.tsx

📝 Walkthrough

Walkthrough

Onboarding now loads up to three enabled platform OAuth providers, includes their metadata in loader and API data for verified users, and displays one-click integration links with optional logos and a BYO OAuth fallback.

Changes

Built-in onboarding providers

Layer / File(s) Summary
Provider data contracts
packages/worker/universal/loader-data.ts, packages/worker/client/routes/onboarding-payload.ts, packages/worker/src/app/onboarding-data.ts
Onboarding loader data and payloads now include provider slugs, labels, nullable logo paths, and provider arrays.
Provider selection and loading
packages/worker/src/integrations/platform-apps.ts, packages/worker/src/integrations/platform-apps.node.test.ts, packages/worker/src/app/handlers/onboarding.ts
Enabled platform apps are ranked by connection count with deterministic tie-breakers. Onboarding maps up to three apps to provider metadata and returns an empty list if loading fails.
Onboarding response propagation
packages/worker/src/app/handlers/onboarding.ts, packages/worker/src/app/onboarding-data.ts, packages/worker/src/app/handlers/onboarding.node.test.ts, packages/worker/src/app/onboarding-data.node.test.ts, packages/worker/src/app/ssr-render.node.test.ts
Page and API onboarding data now carry provider arrays. API responses expose providers only for verified users. Tests expect the new field.
Onboarding integration callout
packages/worker/client/routes/onboarding.tsx
The starter-packages step renders encoded OAuth links for available providers, optional logos, and a BYO OAuth link with responsive styling. The BYOK copy changes when built-in providers exist.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OnboardingRoute
  participant OnboardingHandler
  participant PlatformApps
  participant D1Database
  OnboardingRoute->>OnboardingHandler: request onboarding data
  OnboardingHandler->>PlatformApps: listTopPlatformAppsByUse(limit: 3)
  PlatformApps->>D1Database: query enabled apps and user connection counts
  D1Database-->>PlatformApps: ranked platform app rows
  PlatformApps-->>OnboardingHandler: built-in provider metadata
  OnboardingHandler-->>OnboardingRoute: loader/API data with builtInProviders
  OnboardingRoute->>OnboardingRoute: render OAuth provider links
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding top built-in integrations to onboarding step 3.
Description check ✅ Passed The description explains the intent, implementation, behavior, and testing; its What and How sections adequately cover the template requirements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/onboarding-built-in-providers-c0a2

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.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-1347.kody-a99.workers.dev

Worker: kody-pr-1347
D1: kody-pr-1347-db
KV: kody-pr-1347-oauth-kv

Mocks:

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/worker/src/integrations/platform-apps.node.test.ts (1)

262-293: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for equal connection counts.

The enabled fixtures have distinct connection counts. Add two enabled apps with equal counts and different created_at values. Assert that created_at ASC determines their order.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/worker/src/integrations/platform-apps.node.test.ts` around lines 262
- 293, Add coverage in the listTopPlatformAppsByUse test by adding two enabled
platform apps with equal connection counts but distinct created_at values.
Include connections for both and assert the app with the earlier created_at
appears first, verifying created_at ASC tie-breaking while preserving the
existing ordering and disabled-app assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/worker/client/routes/onboarding.tsx`:
- Around line 805-847: Reconcile the always-visible renderByokDetails disclosure
with the built-in OAuth callout: update renderByokDetails so it no longer claims
there is no one-click connection when builtInProviders is non-empty, or
conditionally hide it in that case. Preserve the existing BYO OAuth guidance
when no built-in providers are available.

In `@packages/worker/src/integrations/platform-apps.ts`:
- Around line 96-114: Update listTopPlatformAppsByUse to remove the global
user_integrations count from ordering, and return platforms in a deterministic
configuration order such as created_at ASC, slug ASC. Do not rank providers
using connector records from any user; preserve the enabled-platform filter and
result mapping.

---

Nitpick comments:
In `@packages/worker/src/integrations/platform-apps.node.test.ts`:
- Around line 262-293: Add coverage in the listTopPlatformAppsByUse test by
adding two enabled platform apps with equal connection counts but distinct
created_at values. Include connections for both and assert the app with the
earlier created_at appears first, verifying created_at ASC tie-breaking while
preserving the existing ordering and disabled-app assertions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 08ebe008-ffaa-4996-98f8-b0c25f6f10a0

📥 Commits

Reviewing files that changed from the base of the PR and between 07279cc and 63c2a1d.

📒 Files selected for processing (10)
  • packages/worker/client/routes/onboarding-payload.ts
  • packages/worker/client/routes/onboarding.tsx
  • packages/worker/src/app/handlers/onboarding.node.test.ts
  • packages/worker/src/app/handlers/onboarding.ts
  • packages/worker/src/app/onboarding-data.node.test.ts
  • packages/worker/src/app/onboarding-data.ts
  • packages/worker/src/app/ssr-render.node.test.ts
  • packages/worker/src/integrations/platform-apps.node.test.ts
  • packages/worker/src/integrations/platform-apps.ts
  • packages/worker/universal/loader-data.ts

Comment thread packages/worker/client/routes/onboarding.tsx
Comment on lines +96 to +114
export async function listTopPlatformAppsByUse(input: {
db: D1Database
limit: number
}): Promise<Array<PlatformOauthApp>> {
const result = await input.db
.prepare(
`SELECT ${platformAppSelectColumns},
(
SELECT count(*) FROM user_integrations
WHERE user_integrations.platform_app_slug = platform_oauth_apps.slug
) AS connection_count
FROM platform_oauth_apps
WHERE enabled = 1
ORDER BY connection_count DESC, created_at ASC, slug ASC
LIMIT ?`,
)
.bind(input.limit)
.all<PlatformOauthAppRow>()
return (result.results ?? []).map(mapPlatformOauthAppRow)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Do not rank providers from other users' connector records.

Lines 103-106 count user_integrations across all users. Line 109 returns that global ranking. The onboarding handler sends this ordering to anonymous and signed-in users. Each user's provider list therefore depends on other users' remote connectors.

Use a deterministic platform configuration order, or a ranking derived only from the current user's data. As per coding guidelines, “each signed-in user must have an independent assistant with separate … remote connectors … and durable storage.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/worker/src/integrations/platform-apps.ts` around lines 96 - 114,
Update listTopPlatformAppsByUse to remove the global user_integrations count
from ordering, and return platforms in a deterministic configuration order such
as created_at ASC, slug ASC. Do not rank providers using connector records from
any user; preserve the enabled-platform filter and result mapping.

Source: Coding guidelines

- the bring-your-own-keys disclosure no longer claims there is no
  one-click connect when built-in providers exist: the heading becomes
  'Why bring your own keys?' and the intro explains built-ins run on a
  Kody-hosted app while BYO remains the full-control lane
- formatter fixes on the two new blocks (the earlier local validate ran
  before the final JSX tweak, so CI caught them)

Skipped the 'do not rank providers from other users' connector
records' finding: the ordering is an aggregate count over
operator-owned platform apps (no per-user data or counts are exposed),
the same class of aggregate as community star counts, and ranking by
use is the explicit product requirement.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kody-bot
kody-bot merged commit ec27b7d into main Aug 9, 2026
10 checks passed
@kody-bot
kody-bot deleted the cursor/onboarding-built-in-providers-c0a2 branch August 9, 2026 18:36
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.

3 participants