
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@subscribe.dev/replicate-frontend-proxy
Advanced tools
AWS Lambda function that serves as a secure proxy for the Replicate API
A secure, serverless proxy service that enables frontend applications to safely interact with Replicate AI models without exposing API credentials in client-side code.
This package provides a ready-to-deploy AWS Lambda function that acts as an intermediary between your frontend applications and the Replicate API. By routing requests through this proxy, you can integrate AI models into your web applications while maintaining security best practices and keeping sensitive API keys on the server side.
The proxy is designed for easy deployment and requires minimal configuration, making it simple to add AI capabilities to any frontend project.
The proxy provides a simple HTTP API that forwards requests to Replicate while maintaining security:
POST /api/replicate - Main proxy endpoint for model predictionsGET /api/replicate - Returns usage instructionsGET /health - Service health checkOPTIONS /api/replicate - CORS preflight supportSend a POST request to your deployed proxy endpoint:
const response = await fetch('https://your-lambda-url.amazonaws.com/api/replicate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'black-forest-labs/flux-schnell',
input: {
prompt: 'a professional headshot of a person',
num_outputs: 1
},
apiKey: 'your-replicate-api-key'
})
});
const result = await response.json();
console.log(result);
bun install
bun run test - Run tests with coveragebun run test:ci - Run tests with CI reporting (JUnit + LCOV)bun run typecheck - Type check TypeScriptbun run build - Build for AWS Lambda deploymentbun run dev - Run locallybun run clean - Clean build and coverage directoriesThe project includes comprehensive tests with:
The project includes automated testing and deployment workflows:
Build the project:
bun run build
Deploy the generated dist/proxy.js to AWS Lambda
Configure your Lambda function with appropriate environment variables and permissions
You can also import this package directly in your own Lambda function:
// Your Lambda handler
module.exports = require('@subscribe.dev/replicate-frontend-proxy');
Ensure your Lambda function has:
This proxy is designed with security as a primary concern:
The proxy acts as a security boundary, ensuring that sensitive API credentials never reach client-side code while maintaining full functionality.
MIT License - see LICENSE file for details.
FAQs
AWS Lambda function that serves as a secure proxy for the Replicate API
We found that @subscribe.dev/replicate-frontend-proxy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.