
Appifio Creator · Lesson AM08 · API REFERENCE §7 · 5 helpers
no network - full structure
Five functions that run immediately in the browser - no await. Use them for dates, slugs, and reading the URL.
appifio_generateSlug(text)What it does: Turn a title into a URL-friendly string (including Vietnamese support).
const slug = appifio_client.appifio_generateSlug('An article about AI');
// → "an-article-about-ai"Returns: slug string. Often used before addRoute / appendData.
appifio_formatDateTime(isoOrSql, format?) · Date/time formatting sectionWhat it does: Display date/time from server data - via CMS settings or presets. Do not hand-roll toLocaleDateString / timezone math.
Inputs the server understands:
YYYY-MM-DD HH:mm:ss(no offset) → treated as UTC, then converted to the display timezone- ISO with
Zor+07:00 - 13-digit timestamp (ms)
format parameter: omit ≈ preset 'datetime'. Presets: 'date' | 'time' | 'datetime' | 'full' | 'iso' | 'us' | 'eu' - or a custom pattern ('d/m/Y H:i', 'j F Y'…).
With Aura CMS (Panel → Settings → Date/time formats): presets date/time/datetime follow site config (IANA timezone, or empty = visitor browser). Typical CMS defaults: date j F Y (e.g. 4 Jul 2026), time H:i.
Without CMS - preset examples:
| Preset | Example |
|---|---|
datetime (default) | 04 Jul 2026 15:30 |
date | 04 Jul 2026 |
time | 15:30:00 |
eu / us / iso / full | EU / US / ISO / full styles |
appifio_client.appifio_formatDateTime(post.created_at); appifio_client.appifio_formatDateTime(post.created_at, 'date'); appifio_client.appifio_formatDateTime(post.created_at, 'd/m/Y H:i');
Returns: formatted string. Every created_at / published_at should go through this before display. Pattern tokens: d j m n Y y F M · H G h g i s a A (+ legacy YYYY MM DD HH mm…).
appifio_formatFileSize(bytes)appifio_client.appifio_formatFileSize(1536000); // → "1.5 MB" (human-readable)
Parameters: byte count. Returns: size string.
appifio_getRouteSlug()What it does: Get the slug segment after the app link name in the current URL (detail / post pages…).
const slug = appifio_client.appifio_getRouteSlug();
Returns: current slug string (may be empty depending on the URL).
appifio_getQueryParams()What it does: Read URL query params like ?id=1&page=2.
const q = appifio_client.appifio_getQueryParams(); // q.id, q.page, ...
Returns: object of key → value pairs.
Blog list example

const res = await appifio_client.appifio_readList('blog.json', ['id','title','slug','created_at']);
for (const post of (res.data?.content || [])) {
const when = appifio_client.appifio_formatDateTime(post.created_at, 'date');
// render...
}Full AM series index = full API REFERENCE
| Lesson | § | Method count |
|---|---|---|
| AM01 | Intro | How to call + standard response |
| AM02 | 1 Indexed | 4 |
| AM03 | 2 Flat | 15 |
| AM04 | 3 FS & upload | 7 |
| AM05 | 4 Route | 3 |
| AM06 | 5 Auth | 12 |
| AM07 | 6 Backend | 1 |
| AM08 | 7 Helper | 5 |
| API REFERENCE method total | 47 (4+15+7+3+12+1+5) | |
Does not include CMS/MCP panel methods - see the AS series (UI only).
Extended index AM09-AM12 (sections outside API REFERENCE)
| Lesson | Guide section | Content |
|---|---|---|
| AM09 | Globals & bootstrap | Bootstrap, global.apps, waitForAppStorage |
| AM10 | URL · Empty · Rate limit | getAbsoluteUrl, required routes, err.blocked |
| AM11 | System files & CMS | Manifest, entity map, security enforce |
| AM12 | Worked examples | Examples 1-9 end-to-end |
Next lesson
Internal navigation (same language)
Appifio Creator · Method series · AM08