On this page
Read account data
Follow references and display account and currency values.
Before you begin: Read a saved record.
Reference Fields
Post and user reference fields are saved as IDs. When a lookup or list template asks for the reference field, Frontbacked expands that field in place:
Nested references use the same field path style. If review.product points to a product and product.category points to a category, read $.product.category.name.
FQL expands up to five reference hops in one requested path. A path like $.review.product.category.name uses two hops: review to product, then product to category. That gives normal product, booking, marketplace, directory, membership, and content sites plenty of room to pull rich connected data while keeping pages fast. For deeper tree-style screens, fetch the next level with another list or detail query.
If a page does not ask for reviewer, product, or another reference field, those fields remain the saved ID values in the returned data.
Auth Shape
Use $auth for the current signed-in user.
The auth object is also system-managed. Frontbacked creates account values when a user signs up with Frontbacked.signUp(), refreshes them when the user signs in with Frontbacked.signIn(), and stores custom user data under $auth.data through Frontbacked.updateUserData().
Add this configuration inside your page’s {STATE} declaration. Inspect state shows its configuration; live queries and saved data run against your local site. Try a complete FQL page →
Common $auth fields:
| Field | Meaning |
|---|---|
$auth.exists | true when a user is signed in. |
$auth.id | Current user id. |
$auth.name | Current user display name. |
$auth.email | Current user email. |
$auth.emailVerified | Email verification state. |
$auth.createdOn | User creation timestamp. |
$auth.updatedOn | User update timestamp. |
$auth.data.phone, $auth.data.country, ... | Custom user data fields from Frontbacked.updateUserData(). |
System fields are at the resource root and theme-owned values are under data: $state.profile.id, $.id, $auth.id, $auth.data.phone, and $.data.name.
Currency
Use $currency for the site owner's platform currency.
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
$currency.value is a currency code such as USD or NGN. If the admin has not selected a currency, Frontbacked uses USD.
Wallet
Use $wallet for the signed-in user's wallet balances. It is auth-backed, so Frontbacked fetches the current user when a page references it.
$wallet.default resolves to the balance for $currency.value. Missing wallet balances resolve to 0, which keeps dashboards renderable before the user has made a completed payment.
Continue with Summarize transactions.