Curated Reference
This is a practical public API reference, not a dump of every implementation detail.
Top-Level
| API | Use |
|---|---|
Nimbu.initialize(accessToken, endpoint?, installationId?) | Initialize browser/external SDK usage. |
Nimbu.useACL() | Make SDK requests respect ACLs by default. |
Nimbu.useSSO(enabled?) | Switch storage prefixing for SSO usage. |
Nimbu.getInstallationId() | Read the generated/stored installation id. |
Nimbu.setAjax(fn) | Replace the network layer. |
Nimbu.setStorage(storage) / setStorageEngine(storage) | Replace SDK storage. |
Nimbu.VERSION | SDK version. |
Nimbu._ | Bundled Underscore helpers. |
Nimbu.Object
| API | Use |
|---|---|
new Nimbu.Object(className, attrs?) | Create an object for a class/channel. |
Nimbu.Object.extend(className) | Create a reusable subclass. |
Subclass.createWithoutData(id) | Create an id-only reference from an Object.extend(...) subclass. |
Nimbu.Object.fromJSON(json, className?) | Decode API JSON into an SDK object. |
Nimbu.Object.saveAll(objects, options?) | Save multiple objects. |
get(attr, options?) | Read an attribute. |
set(key, value, options?) / set(attrs, options?) | Set attributes. |
unset(attr) / clear() | Remove attributes. |
has(attr) | Check whether an attribute has a value. |
increment(attr, amount?) | Queue an atomic increment. |
relation(attr) | Access a relation helper. |
gallery(attr) | Access a gallery helper. |
file(attr) | Access a file helper. |
fetch(options?) | Fetch latest server state. |
fetchWithInclude(keys, options?) | Fetch and include related fields. |
save(attrs?, options?) | Create or update. |
destroy(options?) | Delete. |
toJSON() | Serialize to plain JSON. |
getACL() / setACL(acl) | Read/write ACL. |
Nimbu.Query
| API | Use |
|---|---|
new Nimbu.Query(classNameOrClass) | Create a query. |
find(options?) | Fetch one page as an array. |
findAll(options?) | Fetch all matches as an array. |
first(options?) | Fetch first match. |
get(id, options?) | Fetch by id. |
count(options?) | Count matches. |
findDeleted(options?) | Fetch deleted ids and dates. |
eachBatch(callback, options?) | Process matching objects by batch. |
each(callback, options?) | Process matching objects one by one. |
collection(items?, options?) | Create a collection backed by the query. |
toJSON() / toQueryString() | Inspect serialized query. |
Constraints:
| API | Use |
|---|---|
equalTo, notEqualTo | Equality filters. |
lessThan, lessThanOrEqualTo, greaterThan, greaterThanOrEqualTo | Numeric/date bounds. |
containedIn, notContainedIn, containsAll | Array/list filters. |
exists, doesNotExist | Presence filters. |
contains, startsWith, endsWith, matches, search | Text filters. |
geoWithin, geoIntersects, near, nearCoordinates | Geo filters. |
ascending, descending, addAscending, addDescending | Sort. |
limit, skip, page, per | Pagination. |
include, includeAll, only | Relation resolving and field projection. |
Nimbu.Query.or(...queries) | OR matching. |
Nimbu.Collection
| API | Use |
|---|---|
models | Underlying array. |
length | Number of models. |
add(models) / remove(models) | Mutate collection membership. |
get(id) / getByCid(cid) / at(index) | Look up models. |
fetch(options?) | Fetch from backing query. |
toJSON() | Serialize all models. |
forEach, map, filter, find, reduce, pluck, first, last, size, isEmpty | Underscore-style helpers. |
Field Helpers
| API | Use |
|---|---|
Nimbu.Relation#add/remove/list | Multi-reference fields. |
Nimbu.File(filename, data) | File fields and uploads. |
Nimbu.File#remove() | Queue file removal. |
Nimbu.Gallery#add/remove/list | Gallery fields. |
Nimbu.SelectOption | Single select option object. |
Nimbu.SelectOptionList#values/ids/addValue/removeValue/includesValue | Multiselect fields. |
Specialized Classes
| Class | Notable APIs |
|---|---|
Nimbu.Customer | signUp, logIn, logOut, current, become, requestPasswordReset, authenticated, getAutologinToken. |
Nimbu.Product | getVariants, hasVariants, getSubProducts, addSubProduct, removeSubProduct. |
Nimbu.Order | current, isCurrent, add, remove, getItems. |
Nimbu.Page | Nimbu.Page.get(idOrPath), getItem. |
Nimbu.Role | getName, setName, getCustomers, getRoles, getChildren, getParents. |
Nimbu.Push | send. |
Nimbu.API
| API | Use |
|---|---|
get(path, options?) | Direct GET. |
post(path, body, options?) | Direct POST. |
put(path, body, options?) | Direct PUT. |
patch(path, body, options?) | Direct PATCH. |
delete(path, options?) | Direct DELETE. |
request(method, path, body?, options?) | Low-level request helper. |
Nimbu.Cloud
| API | Use |
|---|---|
Nimbu.Cloud.run(name, params) | Call a Cloud Function. |