A look at CloudKit JS
I use the iOS Notes app to scribble thoughts and lists and the iOS Reminders app for ToDos. Can the CloudKit Notes/Reminders backend-as-a-service power custom web applications or integrate with other web services?
Update: CloudKit JS doesn’t appear to offer a way to access Notes or Reminders via an API.
-
Under the “Before You Begin” section:
[C]reate an iOS or Mac app that uses CloudKit to store your app’s data.
— https://developer.apple.com/documentation/cloudkitjs
A developer must create a iOS or macOS app before using CloudKit JS?
-
“cloudkit” on npmjs.com doesn’t appear to be an official package. Searching for “cloudkit” on npmjs.com doesn’t yield many results.
-
There's no open CloudKit JS code on the github.com/apple org.
-
The CloudKit JS library appears to be browser-only, and only available via Apple’s hosted script:
Embed CloudKit JS in your webpage using the
script
tag and link to Apple’s hosted version of CloudKit JS athttps://cdn.apple-cloudkit.com/ck/2/cloudkit.js
.<script src="https://cdn.apple-cloudkit.com/ck/2/cloudkit.js">
-
tsl-apple-cloudkit exists on typescriptlibs.org, but the source is untrustworthy.
-
Questions for “cloudkit” and “javascript” on stackoverflow.com don’t yield many results (similar for “cloudkit-js” and “cloudkit-web-services”)
-
CloudKit sounds like a service over CouchDB:
An app has access to both a public and private database in each container. The public database is for storing user and app data that is shared between all instances of the app…There’s a private database for each user of your app, but the app only has access to the private database of the current user.
-
Many of the developer.apple.com pages for CloudKit JS have a “this page no longer updated” message at the top.
-
The “CloudKit Catalog: An Introduction to CloudKit (Cocoa and JavaScript)” is very outdated (“Version 6.0, 2016-09-13”) and contains an example with Node.js antipatterns and aged front-end web practices.
-
The CloudKit JS API documentation is a little weird:
- The sections include “Classes,” “Constants,” “Enumerations,” “Structures,” and pages refer to types as “dictionary”…this sounds like a native library!
- Method documentation pages don’t include links to return types; in some cases the return type isn’t named.
Promise
is a property? Modern browsers and Node.js have this as a native object.- Some classes appear to expose a property to identify their type, which is a little un-JavaScript-y (prefer
instanceof
or clearer data structures).
-
CloudKit doesn’t seem to provide an API to Notes nor Reminders: a stackoverflow.com answer indicates that accessing via the web for a server is impossible.