Skip to content

docs(ai): add Vercel AI SDK guide group#3415

Draft
nicolas-angelo wants to merge 6 commits into
mainfrom
nicolas/guides-ai-vercel-ai-sdk
Draft

docs(ai): add Vercel AI SDK guide group#3415
nicolas-angelo wants to merge 6 commits into
mainfrom
nicolas/guides-ai-vercel-ai-sdk

Conversation

@nicolas-angelo

@nicolas-angelo nicolas-angelo commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

New Vercel AI SDK guide sub-group under docs/guides/ai/, scoped to Next.js:

  • Getting started — basic setup for using Clerk w/ AI SDK, linked to the clerk/ai-sdk-examples companion repo
  • Securing chat endpoints — route-level authentication (auth.protect() and auth() + isAuthenticated comparisons), RBAC, machine-token auth (API keys, M2M tokens, multi-token), and a proxy.ts note for public routes
  • Authorizing tool callshas()-gated tool execution by permission, plan, or feature, plus a ## Tool approvals section covering AI SDK v7's toolApproval callback
  • Enriching prompts and runtime context — session/org data into instructions, and passing auth helpers through runtimeContext / toolsContext

Sidebar entries added to manifest.json. New "Vercel AI SDK" section linked from docs/guides/ai/overview.mdx.

Preview

https://clerk.com/docs/pr/nicolas-guides-ai-vercel-ai-sdk/guides/ai/vercel-ai-sdk/getting-started

Companion repo (demo app)
https://github.com/clerk/ai-sdk-examples

Feedback requested

All feedback welcome, but especially interested in:

Resource creation: tabbed or single instruction?
Now that the Clerk CLI is available, resource-creation steps have multiple plausible paths: an agent driving the CLI, a human in a terminal, the Dashboard, or the Backend SDK. I experimented w/ a tabbed pattern seen here.
Happy to collapse if we'd rather stick with one approach.

Grouping: by vendor or by concept?

I leaned vendor (Vercel AI SDK) because they're releasing v7 soon and there may be timing benefit to shipping recipes tied to that release. The alternative is grouping by concept (tool-calling, agent orchestration, prompt enrichment) so patterns generalize across SDKs.

Sticking w/ vendor. Discussed in DM w/ @ manovotny

Test plan

  • pnpm run build:tsx clean (no errors, no warnings)
  • Snippet validation in local playground app
  • Companion repo wired up
  • Local preview review

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-docs Ready Ready Preview Jun 17, 2026 6:50pm

Request Review

@nicolas-angelo nicolas-angelo marked this pull request as ready for review June 17, 2026 18:55
@nicolas-angelo nicolas-angelo requested a review from a team as a code owner June 17, 2026 18:55
@manovotny manovotny marked this pull request as draft July 2, 2026 17:28
@manovotny

Copy link
Copy Markdown
Contributor

Moved back to draft — AI SDK 7 stable release shipped last week, so @nicolas-angelo is going to go back and remove the v6 code snippets since 7 is no longer in beta.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants