Skip to main content

Install

Scope-Enforced Tools

Create Vercel AI SDK tools with Grantex authorization. The token signature and claims are verified and the required scope is checked at execution time, immediately before the application callback runs:

Inspect Grant Scopes

Use getGrantScopes to check what scopes a token has before creating tools:

Audit Logging

Wrap tools with withAuditLogging to log every invocation to the Grantex audit trail:

API Reference

createGrantexTool(options)

Execution throws GrantexScopeError if the verified scope is missing and does not call the application implementation.

getGrantScopes(grantToken)

Returns unverified string[] scopes decoded from the token’s scp claim. Use this only for display or debugging; protected tool execution performs signature verification.

withAuditLogging(tool, client, options)

GrantexScopeError

Requirements

  • Node.js 18+
  • @grantex/sdk >= 0.1.0
  • ai >= 4.0.0 (Vercel AI SDK)
  • zod >= 3.0.0

Ownership

Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: sanjeev@orchestrum.in or mishra.sanjeev@gmail.com.
Last modified on August 31, 2026