In modern software development, the name of the game is leverage. We build powerful applications not by reinventing the wheel, but by assembling best-in-class services into a cohesive stack. You have your frontend framework, your database, your authentication provider—but where does your complex business logic live?
Often, it's scattered across monoliths, tangled in microservices, or painstakingly orchestrated in complex serverless workflows. This is the problem Functions.do solves. It provides a simple, powerful layer for your most critical business logic, delivered as reliable, typesafe functions.
But a new tool is only as good as its ability to play with others. In this post, we'll explore how you can seamlessly integrate Functions.do into your favorite tools and frameworks to supercharge your development workflow and deliver features faster than ever.
Before we plug it in, let's have a quick recap. Functions.do is a developer platform that lets you define, deploy, and execute complex business logic as simple, version-controlled functions.
Think of it as Functions-as-Code for high-level business outcomes.
Unlike traditional FaaS platforms like AWS Lambda, which provide raw infrastructure, Functions.do offers a fully-managed, agentic framework. It's purpose-built for executing business logic, providing native typesafety and abstracting away the operational complexity. You focus on your application's goals, not on managing infrastructure.
The core promise? Go from idea to production-ready API in minutes.
The magic of integrating Functions.do lies in its simplicity. At its heart, interacting with any function is a straightforward async API call.
Here’s the example from the Functions.do homepage:
import { Client } from 'functions.do';
// Initialize the client with your API key
const fns = new Client({ apiKey: 'your_api_key_here' });
// Define the input for a complex business function
const input = {
productName: 'Agentic Workflow Platform',
problem: ['Complex business processes are manual and error-prone.'],
customerSegments: ['Enterprise Developers', 'DevOps Teams']
};
// Execute the function and get a typesafe result
async function generateBusinessModel() {
const leanCanvas = await fns.run('generate/lean-canvas', input);
// The result is fully typed and validated!
console.log(leanCanvas.uniqueValueProposition);
// Expected output: "The simplest way to deliver business services as software."
}
generateBusinessModel();
This single fns.run() call is your universal connector. Because it's standard TypeScript, you can drop this logic into virtually any JavaScript environment. Let's see how.
Imagine you're building a SaaS marketing site on Next.js and want to offer an interactive tool that generates a business plan for potential customers. This kind of complex, AI-driven logic is a perfect fit for Functions.do.
You can call your function directly from a Next.js API Route or, even better, a Server Action.
Example: Using Functions.do in a Next.js Server Action
// app/actions.ts
'use server';
import { Client } from 'functions.do';
import { z } from 'zod';
const fns = new Client({ apiKey: process.env.FUNCTIONS_DO_API_KEY });
const formSchema = z.object({
productName: z.string().min(3),
problem: z.string().min(10),
});
export async function generateCanvas(formData: FormData) {
const validatedFields = formSchema.safeParse({
productName: formData.get('productName'),
problem: formData.get('problem'),
});
if (!validatedFields.success) {
return { error: "Invalid input." };
}
try {
// Offload the heavy lifting to Functions.do
const leanCanvas = await fns.run('generate/lean-canvas', {
productName: validatedFields.data.productName,
problem: [validatedFields.data.problem]
});
// Return the typesafe result to your component
return { data: leanCanvas };
} catch (error) {
console.error(error);
return { error: "Failed to generate business model." };
}
}
The Benefit: You keep your frontend code clean and focused on the UI. The complex, potentially long-running business logic is executed reliably by Functions.do, and you get a guaranteed, typesafe result back in your component. No spinners of death, no server timeouts.
Have an existing backend? You don't need to rewrite it to add powerful new capabilities. Functions.do can act as a "sidecar" for intelligent features.
Let's say you have an Express API for managing users. You can add an endpoint that enriches a user's profile with generated market data, all with a simple function call.
Example: Enriching Data in an Express Route
// routes/users.js
import express from 'express';
import { Client } from 'functions.do';
const router = express.Router();
const fns = new Client({ apiKey: process.env.FUNCTIONS_DO_API_KEY });
router.post('/:id/enrich', async (req, res) => {
const { user } = await getUserById(req.params.id); // Your existing logic
if (!user) {
return res.status(404).json({ error: 'User not found' });
}
try {
// Call a function to perform a complex analysis
const marketAnalysis = await fns.run('analyze/market-for-user', {
userId: user.id,
industry: user.industry,
});
// Save the enriched data and return it
await updateUser(user.id, { ...user, marketAnalysis });
res.json({ success: true, data: marketAnalysis });
} catch (error) {
res.status(500).json({ error: 'Failed to enrich user data.' });
}
});
The Benefit: You can add sophisticated, agentic workflow capabilities to a legacy system without touching the core application logic. Your business logic is now decoupled, versioned, and managed on a platform built for reliability.
What about bridging the gap between your business tools? Every function you deploy on Functions.do is also available via a secure REST endpoint. This means you can integrate with thousands of apps through platforms like Zapier.
Example: A Zapier Workflow
The Benefit: You empower your entire organization to leverage complex, code-driven logic without writing a single line of glue code. This turns a simple function into a powerful, automated business process.
Functions.do isn't just another tool; it's a new layer in your stack designed to simplify complexity and accelerate development. By providing reliable, typesafe function execution through a simple, universal API, it integrates effortlessly into the tools you already use and love.
Whether you're building a modern frontend, maintaining a legacy backend, or automating business workflows, Functions.do provides the power without the pain.
Ready to turn your complex business logic into simple, executable functions? Visit Functions.do to get started!