
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@composio/cloudflare
Advanced tools
The Cloudflare AI provider for Composio SDK, providing seamless integration with Cloudflare's AI capabilities and Workers AI.
The Cloudflare AI provider for Composio SDK, providing seamless integration with Cloudflare's AI capabilities and Workers AI.
npm install @composio/cloudflare
# or
yarn add @composio/cloudflare
# or
pnpm add @composio/cloudflare
import { Composio } from '@composio/core';
import { CloudflareProvider } from '@composio/cloudflare';
// Initialize Composio with Cloudflare provider
const composio = new Composio({
apiKey: 'your-composio-api-key',
provider: new CloudflareProvider({
accountId: 'your-cloudflare-account-id',
apiToken: 'your-cloudflare-api-token',
}),
});
// Get available tools
const tools = await composio.tools.get('user123', {
toolkits: ['gmail', 'googlecalendar'],
limit: 10,
});
import { Composio } from '@composio/core';
import { CloudflareProvider } from '@composio/cloudflare';
import { Ai } from '@cloudflare/ai';
// Initialize Composio
const composio = new Composio({
apiKey: process.env.COMPOSIO_API_KEY,
provider: new CloudflareProvider(),
});
// In your Worker
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
const ai = new Ai(env.AI);
const tools = await composio.tools.get('user123', {
toolkits: ['gmail'],
});
const messages = [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'What can you do?' },
];
const stream = await ai.run('@cf/meta/llama-2-7b-chat-int8', {
messages,
tools,
stream: true,
});
return new Response(stream, {
headers: {
'content-type': 'text/event-stream',
},
});
},
};
import { Composio } from '@composio/core';
import { CloudflareProvider } from '@composio/cloudflare';
import { Ai } from '@cloudflare/ai';
// Initialize Composio
const composio = new Composio({
apiKey: process.env.COMPOSIO_API_KEY,
provider: new CloudflareProvider(),
});
// In your Worker
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
const ai = new Ai(env.AI);
const tools = await composio.tools.get('user123', {
toolkits: ['gmail'],
});
// Image analysis
const imageResponse = await ai.run('@cf/microsoft/resnet-50', {
image: await request.arrayBuffer(),
});
// Use image analysis in chat
const messages = [
{ role: 'system', content: 'You are a helpful assistant.' },
{
role: 'user',
content: 'What do you see in this image?',
context: { image_analysis: imageResponse },
},
];
const stream = await ai.run('@cf/meta/llama-2-7b-chat-int8', {
messages,
tools,
stream: true,
});
return new Response(stream, {
headers: {
'content-type': 'text/event-stream',
},
});
},
};
The CloudflareProvider
class extends BaseComposioProvider
and provides Cloudflare-specific functionality.
executeToolCall(tool: ToolCall): Promise<string>
Executes a tool call and returns the result.
const result = await composio.provider.executeToolCall(toolCall);
We welcome contributions! Please see our Contributing Guide for more details.
ISC License
For support, please visit our Documentation or join our Discord Community.
FAQs
The Cloudflare AI provider for Composio SDK, providing seamless integration with Cloudflare's AI capabilities and Workers AI.
We found that @composio/cloudflare demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.