
Appifio Creator · Lesson EM08 · Easy · 1 network method + Secrets
full structure - params · returns · notes
Run JS on the server (sandbox). Secrets are configured in the UI only - visitors cannot read raw secret values from the page.
appifio_executeBackendFunction(functionName, params?)Job: Call a function stored at backend/functions/{name}.js.
Who can call: Needs a page session key (Easy has no admin-token layer).
Params:
functionName- letters/digits/_/- , 1-64 chars; matches the file name (no extension)params- object (default{}) → becomesappifio.paramsin the handler
const r = await appifio_client.appifio_executeBackendFunction('greetUser', {
name: 'An'
});
if (r.success) {
console.log(r.data.result); // value the handler returned
// r.data.execution_time - run time (if present)
}Returns: { success, data: { result, … }, message? }
Notes: Handler must be exports.handler = async (appifio) => {…}. No arbitrary system libraries; timeout & memory are limited. Create the function file with writeFsFile (EM05).
Secrets (not a client method that reads raw values)

- Add them on the Backend tab → Secrets manager
- Key names:
A-Z,0-9,_- e.g.SMTP_PASSWORD - In the handler:
await appifio.secrets.get('SMTP_PASSWORD') - No
appifio_readSecreton the page - by design
// backend/functions/sendMail.js (shortened)
exports.handler = async (appifio) => {
const pass = await appifio.secrets.get('SMTP_PASSWORD');
// … send mail with pass - do not return pass to the client
return { ok: true };
};secrets.get in the handlerlogin / registerAdmin / getSession. Anyone with a page session key has near-full write access.Next
EM09 - Blog example + overall checklist
Internal navigation (same language)
Appifio Creator · User guide · EM08