Functions quickstart
Write a handler, deploy it, call it — five minutes.
1. Put your function in a repository
A function is one directory with an index.php in it:
your-repo/
└── functions/
└── hello/
└── index.php
<?php
use Flares\Functions\Request;
use Flares\Functions\Response;
return function (Request $request): Response {
return Response::json([
'hello' => $request->query('name', 'world'),
]);
};
Commit and push it. That is the last time you will do anything by hand.
2. Create the function in Flares
In your project open Functions → Create function. Give it a name — lowercase letters, digits and hyphens; it becomes part of the URL — and choose whether it is public or requires Flares Auth.

3. Connect the repository
Open Source and press Connect GitHub. Install the Flares app, choose which repositories it may read, then pick:
- Repository —
you/your-repo - Branch —
main - Root directory —
functions/hello

Flares asks for read access only, and never asks for a password, a token or an SSH key. How the GitHub integration works →
4. Deploy
Press Deploy latest. Flares resolves your branch to an exact commit, fetches it, validates it, installs Composer dependencies if you declared any, and makes it live:
Commit a71c9ef on main
Fetching you/your-repo at a71c9ef…
Root directory functions/hello.
Manifest OK: handler index.php.
Lint OK.
Deployment #1 is live.

5. Call it
curl 'https://cloud.flaresinc.com/run/YOUR_PROJECT_ID/hello?name=flares'
# {"hello":"flares"}
Every response carries X-Flares-Request-Id — the id its log line is searchable by.
6. Change it
git commit -am "Return a greeting"
git push
That is the whole deploy step from now on. Flares builds the commit you pushed and switches production to it if the build succeeds — and leaves the working version serving if it does not.

7. Watch it
Logs shows each invocation: request id, method, status, duration and anything your code printed. Overview shows request and error counts and p50/p95/p99 latency measured from real samples.

Next
- Monorepos, auto-deploy, private repositories, troubleshooting
- Deployments and rollback
- Variables and secrets — keep them out of Git
- Billing — requests only; builds and pushes are free