Vercel Connect
For agents deployed on Vercel, Vercel Connect replaces long-lived PATs. Attach a GitHub connector to your project and mint short-lived, scoped tokens at runtime — no secret to store.
The @github-tools/sdk/connect subpath wraps Connect with preset-derived scopes so you only think about the connector and preset.
Quick start (AI SDK)
import { connectGithubTools } from '@github-tools/sdk/connect'
import { generateText } from 'ai'
const tools = connectGithubTools('github/my-connector', {
preset: 'code-review',
})
const { text } = await generateText({
model: 'anthropic/claude-sonnet-4.6',
tools,
prompt: 'Summarize open PRs on my-org/my-repo.',
})
Scopes are derived automatically from the preset — see the preset → Connect scope matrix.
eve agent
import { defineAgent } from 'eve'
export default defineAgent({
model: 'anthropic/claude-sonnet-5',
// TODO(eve-connect-bundle): remove when eve externalizes transitive @vercel/connect
build: {
externalDependencies: ['@vercel/connect'],
},
})
import { connectGithubTools } from '@github-tools/sdk/connect/eve'
export default connectGithubTools('github/my-connector', {
preset: 'maintainer',
})
build.externalDependencies keeps @vercel/connect out of the authored-module bundle. Without it, eve dev fails when the SDK is workspace-linked. This is temporary until eve handles transitive Connect imports upstream.See examples/eve-agent for a runnable example.
Token provider only
When you need a lazy token for custom tool factories:
import { connectGithubToken } from '@github-tools/sdk/connect'
import { createGithubTools } from '@github-tools/sdk'
const tools = createGithubTools({
preset: 'ci-ops',
token: connectGithubToken('github/my-connector', { preset: 'ci-ops' }),
})
Pass the same preset to both calls — connectGithubToken derives Connect scopes from its own preset option, independently of the one you give createGithubTools. Omitting it mints a token scoped to the union of every preset instead of just ci-ops.
Multi-tenant and repository scoping
Override Connect parameters when you need installation targeting or narrower repository access:
import { connectGithubTools } from '@github-tools/sdk/connect'
const tools = connectGithubTools('github/my-connector', {
preset: 'issue-triage',
connect: {
installationId: 'inst_abc',
repositories: ['vercel-labs/github-tools'],
scopes: ['issues:write'], // replaces preset-derived scopes when provided
},
})
subject is always { type: 'app' } — same as connectGitHubAdapter from @vercel/connect.
Setup checklist
Create a GitHub connector
Create a connector from the Vercel dashboard (or vercel connect in the CLI), then install it on the GitHub org or user account your agent needs.
Or jump straight to the GitHub connector creation form with this deeplink.
Link it to your project
Link the connector to the Vercel project that runs your agent. On Vercel, the SDK authenticates automatically with the deployment OIDC token. For local development, run vercel link then vercel env pull.
Install the peer dependency
pnpm add @vercel/connect
@vercel/connect is an optional peer dependency of @github-tools/sdk — install it only when using the /connect subpath.
Manual getToken (escape hatch)
If you need full control over every ConnectTokenParams field, call getToken directly and pass the result as token. See Tokens & Auth.
API reference
connectGithubTools— AI SDK tool setconnectGithubTools(eve) — evedefineDynamicsentinelconnectGithubToken— lazy token providerconnectGithubScopesForPreset— scope helper
External references
Examples
Complete GitHub agent examples for every framework — AI SDK scripts, eve agents, durable Vercel Workflow routes, and Chat SDK bots you can copy and adapt.
Tools Catalog
Every available tool, grouped by domain and write-safety status. Tools run as durable workflow steps when used with Vercel Workflow.