Socket
Book a DemoInstallSign in
Socket

ai.matey.http.core

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai.matey.http.core

Framework-agnostic HTTP core utilities for AI Matey

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

ai.matey.http.core

Core HTTP utilities shared across integrations

Part of the ai.matey monorepo.

Installation

npm install ai.matey.http.core

Quick Start

import { createCorsMiddleware } from 'ai.matey.http.core';
import { Bridge } from 'ai.matey.core';
import { OpenAIFrontendAdapter } from 'ai.matey.frontend/openai';
import { OpenAIBackendAdapter } from 'ai.matey.backend/openai';

const bridge = new Bridge(
  new OpenAIFrontendAdapter(),
  new OpenAIBackendAdapter({ apiKey: process.env.OPENAI_API_KEY })
);

const handler = createCorsMiddleware(bridge, {
  streaming: true,
  timeout: 30000,
});

// Use with your Core server

API Reference

createCorsMiddleware

Creates an HTTP handler for Core.

createCorsMiddleware(bridge: Bridge, options?: HandlerOptions): Handler

Options

OptionTypeDefaultDescription
streamingbooleantrueEnable streaming responses
timeoutnumber30000Request timeout in milliseconds
corsbooleanfalseEnable CORS headers

Exports

  • createCorsMiddleware
  • validateApiKey
  • parseRequestBody

License

MIT - see LICENSE for details.

Keywords

ai

FAQs

Package last updated on 29 Nov 2025

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