
Security News
minimatch Patches 3 High-Severity ReDoS Vulnerabilities
minimatch patched three high-severity ReDoS vulnerabilities that can stall the Node.js event loop, and Socket has released free certified patches.
@expandai/ai
Advanced tools
Vercel AI SDK integration for expand.ai - fetch and extract content from any URL
Vercel AI SDK integration for Expand - fetch and extract content from any URL with AI.
npm install @expandai/ai ai zod
# or
pnpm add @expandai/ai ai zod
# or
yarn add @expandai/ai ai zod
You need an Expand API key. Get one at expand.ai.
Set your API key as an environment variable:
export EXPAND_API_KEY=your_api_key_here
import { expandFetchTool } from '@expandai/ai'
import { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
const result = await generateText({
model: openai('gpt-4'),
tools: {
expandFetch: expandFetchTool,
},
prompt: 'What is on the Expand homepage at https://expand.ai?',
})
console.log(result.text)
import { createExpandFetchTool } from '@expandai/ai'
const customTool = createExpandFetchTool({
apiKey: 'your_custom_api_key',
description: 'Custom tool description for your specific use case',
})
const result = await generateText({
model: openai('gpt-4'),
tools: {
fetch: customTool,
},
prompt: 'Summarize the content at https://example.com',
})
import { expandFetchTool } from '@expandai/ai'
import { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
import { weatherTool } from './other-tools'
const result = await generateText({
model: openai('gpt-4'),
tools: {
expandFetch: expandFetchTool,
weather: weatherTool,
},
prompt: 'Check the weather forecast on https://weather.com and plan my weekend',
})
expandFetchToolThe default tool instance that uses the EXPAND_API_KEY environment variable.
import { expandFetchTool } from '@expandai/ai'
createExpandFetchTool(options?)Create a custom Expand fetch tool with specific configuration.
Parameters:
options.apiKey (optional): Expand API key. Defaults to process.env.EXPAND_API_KEYoptions.description (optional): Custom tool description for the AI modelReturns: A Vercel AI SDK tool
import { createExpandFetchTool } from '@expandai/ai'
const tool = createExpandFetchTool({
apiKey: 'your_api_key',
description: 'Fetch web content for analysis',
})
The tool returns an object with:
url: The fetched URLmarkdown: The extracted content in Markdown formatmeta: Metadata object containing:
title: Page titledescription: Page descriptionimport { expandFetchTool } from '@expandai/ai'
import { generateText } from 'ai'
import { anthropic } from '@ai-sdk/anthropic'
const result = await generateText({
model: anthropic('claude-3-5-sonnet-20241022'),
tools: {
expandFetch: expandFetchTool,
},
prompt: `
Research the latest developments in AI from these sources:
- https://openai.com/blog
- https://www.anthropic.com/news
Provide a summary of the most important updates.
`,
})
import { expandFetchTool } from '@expandai/ai'
import { streamText } from 'ai'
import { openai } from '@ai-sdk/openai'
const result = await streamText({
model: openai('gpt-4-turbo'),
tools: {
expandFetch: expandFetchTool,
},
prompt: `
Compare the pricing pages of:
- https://vercel.com/pricing
- https://netlify.com/pricing
Which one offers better value for small teams?
`,
})
for await (const chunk of result.textStream) {
process.stdout.write(chunk)
}
import { createExpandFetchTool } from '@expandai/ai'
import { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
try {
const tool = createExpandFetchTool({ apiKey: process.env.EXPAND_API_KEY })
const result = await generateText({
model: openai('gpt-4'),
tools: { expandFetch: tool },
prompt: 'Fetch https://example.com',
})
} catch (error) {
console.error('Failed to fetch content:', error)
}
ai >= 3.0.0zod >= 3.0.0Apache-2.0
For issues and questions:
FAQs
Vercel AI SDK integration for expand.ai - fetch and extract content from any URL
The npm package @expandai/ai receives a total of 125 weekly downloads. As such, @expandai/ai popularity was classified as not popular.
We found that @expandai/ai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

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.

Security News
minimatch patched three high-severity ReDoS vulnerabilities that can stall the Node.js event loop, and Socket has released free certified patches.

Research
/Security News
Socket uncovered 26 malicious npm packages tied to North Korea's Contagious Interview campaign, retrieving a live 9-module infostealer and RAT from the adversary's C2.

Research
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.