docs(ai): add Vercel AI SDK guide group#3415
Draft
nicolas-angelo wants to merge 6 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
Vercel AI SDKguide sub-group underdocs/guides/ai/, scoped to Next.js:clerk/ai-sdk-examplescompanion repoauth.protect()andauth() + isAuthenticatedcomparisons), RBAC, machine-token auth (API keys, M2M tokens, multi-token), and aproxy.tsnote for public routeshas()-gated tool execution by permission, plan, or feature, plus a## Tool approvalssection covering AI SDK v7'stoolApprovalcallbackinstructions, and passing auth helpers throughruntimeContext/toolsContextSidebar entries added to
manifest.json. New "Vercel AI SDK" section linked fromdocs/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:tsxclean (no errors, no warnings)