Skip to content

Curated Reference

This is a practical public API reference, not a dump of every implementation detail.

Top-Level

APIUse
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.VERSIONSDK version.
Nimbu._Bundled Underscore helpers.

Nimbu.Object

APIUse
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

APIUse
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:

APIUse
equalTo, notEqualToEquality filters.
lessThan, lessThanOrEqualTo, greaterThan, greaterThanOrEqualToNumeric/date bounds.
containedIn, notContainedIn, containsAllArray/list filters.
exists, doesNotExistPresence filters.
contains, startsWith, endsWith, matches, searchText filters.
geoWithin, geoIntersects, near, nearCoordinatesGeo filters.
ascending, descending, addAscending, addDescendingSort.
limit, skip, page, perPagination.
include, includeAll, onlyRelation resolving and field projection.
Nimbu.Query.or(...queries)OR matching.

Nimbu.Collection

APIUse
modelsUnderlying array.
lengthNumber 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, isEmptyUnderscore-style helpers.

Field Helpers

APIUse
Nimbu.Relation#add/remove/listMulti-reference fields.
Nimbu.File(filename, data)File fields and uploads.
Nimbu.File#remove()Queue file removal.
Nimbu.Gallery#add/remove/listGallery fields.
Nimbu.SelectOptionSingle select option object.
Nimbu.SelectOptionList#values/ids/addValue/removeValue/includesValueMultiselect fields.

Specialized Classes

ClassNotable APIs
Nimbu.CustomersignUp, logIn, logOut, current, become, requestPasswordReset, authenticated, getAutologinToken.
Nimbu.ProductgetVariants, hasVariants, getSubProducts, addSubProduct, removeSubProduct.
Nimbu.Ordercurrent, isCurrent, add, remove, getItems.
Nimbu.PageNimbu.Page.get(idOrPath), getItem.
Nimbu.RolegetName, setName, getCustomers, getRoles, getChildren, getParents.
Nimbu.Pushsend.

Nimbu.API

APIUse
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

APIUse
Nimbu.Cloud.run(name, params)Call a Cloud Function.

Part of Nimbu, built by Zenjoy.