Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

content-agent

Package Overview
Dependencies
Maintainers
113
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

content-agent

Vercel AI SDK provider for Sanity Content Agent API

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
144
220%
Maintainers
113
Weekly downloads
 
Created
Source

content-agent

Vercel AI SDK provider for Sanity Content Agent API.

Installation

npm install content-agent ai

Usage

Create a provider instance with your organization ID and token, then use .agent(threadId) to get a model for a conversation thread:

import { createContentAgent } from "content-agent";
import { generateText } from "ai";

const contentAgent = createContentAgent({
  organizationId: "your-org-id",
  token: "your-sanity-token",
});

const model = contentAgent.agent("my-thread");

const result = await generateText({
  model,
  prompt: "What blog posts do I have?",
});

console.log(result.text);

Streaming

Use streamText from the AI SDK for streaming responses:

import { streamText } from "ai";

const { textStream } = await streamText({
  model: contentAgent.agent("my-thread"),
  prompt: "Summarize my latest content",
});

for await (const text of textStream) {
  process.stdout.write(text);
}

Configuration

Pass settings to .agent() to configure capabilities and target a specific application:

const model = contentAgent.agent("my-thread", {
  application: {
    key: "projectId.datasetName",
  },
  config: {
    capabilities: {
      read: true,
      write: false,
    },
  },
});

License

MIT

Keywords

sanity

FAQs

Package last updated on 03 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts