Skip to content
Core feature · free tier

Browser functions: your code, our headless browser

Run any JavaScript remotely with the function parameter — full Puppeteer access, npm packages installed on the fly, and zero infrastructure. No Lambda bundle, no browser fleet, no server to manage.

Your function, executed remotely
function · every plan
Your code
plain JavaScript function
@microlink
/function
serialize · compress · send
Microlink sandbox
npm install · headless Chrome
result.value
plus execution profiling

Reference page and a browser starts with full Puppeteer access — skip it and your function runs faster.

Send a function, get the result

Write a normal JavaScript function and run it remotely in a sandboxed Node.js runtime. The return value comes back at result.value; if the function throws, result.isFulfilled is false and the error details take its place.

When the function references page, Microlink spawns headless Chrome, navigates to the target URL, and hands you the full Puppeteer API — click, type, evaluate, capture. When it does not, no browser is started and execution is faster and cheaper.

Need a library? require() any npm package — dependencies are detected from your code, installed into the sandbox on the fly, and cached so subsequent runs skip the install entirely.

Three execution shapes → one parameter

From a one-liner to full browser automation

Every function runs in the same sandboxed runtime — what you reference inside it decides how much machinery spins up. Pay the browser cost only when you actually need a browser.

01 · plain functions
Compute and orchestrate
Return strings, numbers, arrays, or objects from plain JavaScript — no browser started. Any extra parameter on the request is forwarded to the function, so one function is reusable across different requests without changing its code.
result.valuecustom parametersno browser
02 · page
Full Puppeteer access
Reference page and Microlink boots headless Chrome, navigates to the target URL, and passes you the live Puppeteer page — click, type, wait, evaluate, or capture anything the built-in parameters cannot express.
page.title()page.click()page.evaluate()
03 · require()
Any npm package, on the fly
Call require() inside your function and the runtime detects the dependencies, installs them into the sandbox, bundles, and caches the result — pin a version with require('[email protected]') when you need reproducibility.
require('[email protected]')lodashinstall cache
Code

Puppeteer, without the infrastructure

The @microlink/function library handles serialization, compression, and the API call. Your function receives page — a live Puppeteer instance already navigated to the target URL.

index.js
const microlink = require('@microlink/function')

const fn = microlink(({ page }) => page.title())
const result = await fn('https://example.com')

console.log(result.isFulfilled) // true
console.log(result.value) // 'Example Domain'
npm

Dependencies, resolved for you

Write require() as if you were on your own machine. The first run installs and caches; subsequent runs skip the install phase — check result.profiling.phases to see exactly where the time goes.

index.js
const microlink = require('@microlink/function')

const fn = microlink(() => {
  const { kebabCase } = require('lodash')
  return kebabCase('Hello World')
})

const result = await fn('https://example.com')
console.log(result.value) // 'hello-world'
Prototype free, scale on Pro

The same runtime on every plan

Functions run on the free tier — enough to prototype workflows and every example on this page. Pro raises the execution limits and unlocks the parameters production scraping needs alongside your code.

01 · execution limits
More time, more memory, more at once
Free runs cap at 5 seconds, 16 MB, 1024 bytes of code, and one concurrent execution per IP. Pro extends the timeout up to 28 seconds, doubles the memory, and removes the code-size and concurrency caps.
5s timeout16 MB memory1024-byte code
28s timeout32 MB memoryunlimited code sizeunlimited concurrency
02 · pro parameters
Combine with the unblocking layer
On Pro, your function composes with automatic proxy resolution when antibots block the target, custom headers for pages behind a login, and configurable TTL so repeated executions serve from cache instead of your quota.

Your code, our browser.

Prototype on the free tier — no API key, no setup. When your workload grows, Pro plans raise the execution limits and add proxy resolution, custom headers, and configurable TTL around your code.

What can I run inside a function?

Any JavaScript. Plain functions run in a sandboxed Node.js runtime and can return strings, numbers, arrays, or objects. Reference page and Microlink starts headless Chrome with full Puppeteer access, already navigated to the target URL.
You can also require() any npm package — dependencies are installed on the fly and cached.

Is the function parameter available on the free plan?

Yes. Free runs get a 5-second timeout, 16 MB of memory, 1024 bytes of code, and one concurrent execution per IP — enough to prototype workflows.
Pro plans extend the timeout up to 28 seconds, raise memory to 32 MB, and remove the code-size and concurrency limits.

When should I use function instead of data?

Start with data — declarative CSS-selector rules are shorter, easier to maintain, and easier to reuse. Escalate to function when you need to click, wait, compute, reshape, or orchestrate custom logic that rules cannot express.
For injecting CSS or JavaScript before another workflow, the styles, scripts, and modules parameters are lighter than a full function — see browser automation.

What happens if my function throws?

The request still succeeds: result.isFulfilled comes back false and result.value contains the error details — name, code, and message — so you can handle failures in your own code.
Security-restricted operations, such as spawning child processes, return an ERR_ACCESS_DENIED error — see the troubleshooting guide.

How do I make functions run faster?

Skip page when you do not need a browser — plain functions execute without booting Chrome.
Check result.profiling.phases to see where time goes: a high install value means dependencies were installed for the first time and will be cached for subsequent runs; a high run value means the function itself is doing heavy work — see the profiling guide.

Can functions reach pages behind antibots or logins?

Yes, on Pro plans. Combine function with automatic proxy resolution to get past Cloudflare, DataDome, or Akamai, and forward session cookies with x-api-header-cookie for pages behind a login — see custom headers.
The browser your function receives is already unblocked and authenticated.