
Appifio Creator · Lesson T02 · Glossary
appifio_clientand bootstrap inject
The backend library is already injected into the page - the AI (and you) may call it, never rewrite the class.
Goals: Know why appifio_client is always there; use waitForAppStorage(); avoid a wrong typeof === 'undefined' check.
Before: T01, F01 · Next: T03 · UI labels: Backend tab · Ask AI about backend · Easy / Advanced
1. Inject flow
window.appifio.global.apps (project code / Appifio link name, api_url, api_key, backend_version)window.appifio_client2. Glossary
| Term | Meaning | Where you see it |
|---|---|---|
| Bootstrap inject | System script auto-injected into every app page | No button - always runs on live/preview |
| appifio_client | Object that calls Storage APIs (DB + file store + auth + routes) | Console / AI-generated code |
| proxyClient | Queue while the real client is still loading | Hidden - why typeof always “exists” |
| waitForAppStorage() | Promise that waits until the client is ready | Global bootstrap helper |
| encoded_key / api_key | Page-session token (not the admin token) | Backend tab · “Your backend API key” |
3. Verify it (no coding background required)
- Open Creator → Backend tab - confirm an API key and Easy or Advanced.
- Open the Current preview (after Save) → F12 Console → type:
typeof appifio_client→ always"object"(getter), never undefined. - Type:
await waitForAppStorage()then tryawait appifio_client.appifio_listFiles()(or the matching method) - with the right Easy/Advanced permissions you get a result. - In chat, pick mode Coder or click Ask AI about backend (Backend tab) and ask: “Use the existing appifio_client - do NOT redefine class AppStorageClient.”
- If the AI invents
class AppStorageClientor rawfetch()to an endpoint → reject the Diff (✗) and restate Aura Storage rules.
4. Right / wrong in code
| ✅ Right | ❌ Wrong |
|---|---|
await waitForAppStorage() then call methods | typeof appifio_client === 'undefined' |
Call appifio_appendData / appifio_readList | Raw fetch to the API (skips auth and rate limits) |
Use project code / Appifio link name from window.appifio.global.apps | Hardcode a slug for the wrong environment |
5. Comparisons
- Firebase / Supabase client SDK: you import it yourself; Appifio injects it.
- Bubble: data layer stays behind the visual builder; Appifio exposes a deliberate JS API for AI and coders.
- WordPress REST: you handle auth yourself; here page session and admin token are separate layers.
6. Can / can’t · Security
You can: CRUD JSON, site file store, routes, admin auth, upload (with the right role), backend functions. You can’t: rewrite the client; ask the AI to disable send limits; read passwords in clear text.
Security: The Backend-tab API key is scoped to the app - don’t paste it publicly; keep the page api_key distinct from the admin token after login.
7. Common issues
| Situation | Fix |
|---|---|
| Code runs “too early” and fails | await waitForAppStorage(); bootstrap already queues work past DOMContentLoaded |
| AI invents a new client | Reject Diff; insist on the existing appifio_client (don’t rewrite the library) |
| Easy vs Advanced behaves differently | Check the Backend tab · lesson T06 |
8. Tips · Checklist
- Fixed prompt: “Use the existing appifio_client - do not rewrite appifio_* methods.”
- Always try/catch and show a friendly message when a rate limit hits.
- Do you know why
typeof appifio_client === 'undefined'is always wrong? - Can you open the Backend tab and see the API key?
Next: T03 - Flat JSON vs Indexed
Internal navigation (same language)
Appifio Creator · User guide · T02