AWS Lambda & Serverless

Your node_modules
just got expensive.

Since August 2025, AWS bills for Lambda INIT time. That 2.5 MB of utility packages? It's now costing you 450ms of billable time on every cold start. TinyFn adds zero bytes to your bundle.

INIT Time Breakdown

With packages
lodash moment validator +12 more
+450ms
With TinyFn
+15ms
INIT reduction 435ms
Per 1M cold starts ~$2.90

Complete Example

A production-ready Lambda function with zero utility dependencies.

INIT is now billable

Before August 2025, Lambda INIT time was free. Now it's metered. A function with 2.5 MB of dependencies spends ~450ms just parsing JavaScript before your code even runs. At scale, that's real money. TinyFn moves those utilities to API calls—your bundle stays tiny, your INIT stays fast.

handler.js
~2 KB
const TINYFN = 'https://api.tinyfn.io/v1';
const API_KEY = process.env.TINYFN_API_KEY;

async function tinyfn(endpoint, params = {}) {
  const url = new URL(`${TINYFN}${endpoint}`);
  Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v));
  const res = await fetch(url, { headers: { 'X-API-Key': API_KEY } });
  return res.json();
}

exports.handler = async (event) => {
  const body = JSON.parse(event.body);

  // Validate email
  const emailCheck = await tinyfn('/validate/email', { email: body.email });
  if (!emailCheck.is_valid) {
    return { statusCode: 400, body: JSON.stringify({ error: 'Invalid email' }) };
  }

  // Generate user ID
  const { uuid } = await tinyfn('/generate/uuid');

  // Create URL slug from name
  const { slug } = await tinyfn('/string/slug', { text: body.name });

  return {
    statusCode: 200,
    body: JSON.stringify({ id: uuid, username: slug, email: body.email })
  };
};
main.ts
Deno Deploy
const TINYFN = 'https://api.tinyfn.io/v1';
const API_KEY = Deno.env.get('TINYFN_API_KEY')!;

async function tinyfn(endpoint: string, params: Record = {}) {
  const url = new URL(`${TINYFN}${endpoint}`);
  Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v));
  const res = await fetch(url, { headers: { 'X-API-Key': API_KEY } });
  return res.json();
}

Deno.serve(async (req: Request) => {
  if (req.method !== 'POST') {
    return new Response('Method not allowed', { status: 405 });
  }

  const { email, text } = await req.json();

  // Parallel requests for performance
  const [emailResult, uuidResult] = await Promise.all([
    tinyfn('/validate/email', { email }),
    tinyfn('/generate/uuid'),
  ]);

  return Response.json({
    valid_email: emailResult.is_valid,
    request_id: uuidResult.uuid,
  });
});
index.ts
Supabase Edge
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts';

const TINYFN = 'https://api.tinyfn.io/v1';
const API_KEY = Deno.env.get('TINYFN_API_KEY')!;

async function tinyfn(endpoint: string, params: Record = {}) {
  const url = new URL(`${TINYFN}${endpoint}`);
  Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v));
  const res = await fetch(url, { headers: { 'X-API-Key': API_KEY } });
  return res.json();
}

serve(async (req) => {
  const { email, password } = await req.json();

  // Validate email
  const emailCheck = await tinyfn('/validate/email', { email });
  if (!emailCheck.is_valid) {
    return Response.json({ error: 'Invalid email' }, { status: 400 });
  }

  // Check password strength
  const pwCheck = await tinyfn('/password/strength', { password });
  if (pwCheck.score < 3) {
    return Response.json({ error: 'Weak password' }, { status: 400 });
  }

  return Response.json({ success: true });
});

Production Patterns

Real-world examples from functions handling millions of invocations. Drop in and deploy.

Webhook Processing

// Verify Stripe webhook signature
const { hash } = await tinyfn('/crypto/hmac-sha256', {
  text: rawBody,
  key: STRIPE_WEBHOOK_SECRET
});

if (hash !== stripeSignature) {
  return { statusCode: 401 };
}

User Registration

// Validate and process signup
const [email, pw, id] = await Promise.all([
  tinyfn('/validate/email', { email: body.email }),
  tinyfn('/password/strength', { password: body.pw }),
  tinyfn('/generate/uuid')
]);

if (!email.is_valid || pw.score < 3) {
  return { statusCode: 400 };
}

Data Processing

// Generate cache key from data
const { hash } = await tinyfn('/hash/sha256', {
  text: JSON.stringify(queryParams)
});

const cacheKey = `query:${hash.slice(0, 16)}`;
const cached = await cache.get(cacheKey);

API Gateway Auth

// Decode JWT for Lambda authorizer
const token = event.headers.authorization
  ?.replace('Bearer ', '');

const { payload } = await tinyfn('/jwt/decode', {
  token
});

return { principalId: payload.sub };

Every Platform Has Limits

Bundle size matters everywhere. Here's how TinyFn helps across the serverless ecosystem.

Platform
Size Limit
Timeout
TinyFn Benefit
AWS Lambda
250 MB
15 min
Reduce INIT billing costs
Lambda@Edge
1-50 MB
5-30 sec
Critical — limits are tight
Supabase Edge
2 MB
150ms CPU
Essential — very tight limits
Deno Deploy
1 GB total
50ms CPU
Faster deploys, less storage
Netlify Functions
52.4 MB
10-26 sec
Faster cold starts

Popular Endpoints

Most-used utilities for serverless functions.

The Business Case

TinyFn pays for itself. Here's why teams are switching.

Reduce AWS Spend

INIT billing adds up fast. Cut 435ms off every cold start and watch your bill shrink.

Hit Your SLAs

P95 latency matters. Eliminate parsing overhead and hit your targets consistently.

Fewer CVEs

One API to audit vs 47 npm packages. Security reviews just got easier.

Multi-Cloud Ready

Same code runs on Lambda, Deno, Supabase, Vercel. No vendor lock-in on utilities.

Cut your INIT costs today

Free tier includes 10,000 requests/month. See the cold start difference in your next deploy.