Backend tab where Secrets manager lives under API key and version cards
Backend home for Secrets

Appifio Creator · Lesson EM08 · Easy · 1 network method + Secrets

Server functions
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 {}) → becomes appifio.params in 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)

Secrets manager with Add secret and appifio.secrets.get tip
Secrets manager
  • 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_readSecret on 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 };
};
EM08 checklist: executeBackendFunction (1/1 network method) · Secrets only via UI + secrets.get in the handler
No AM06 equivalent on Easy: no login / registerAdmin / getSession. Anyone with a page session key has near-full write access.

Next

EM09 - Blog example + overall checklist

Appifio Creator · User guide · EM08