- api.name: Your plugin's folder name, e.g. "my-plugin"
- api.dir: Your installed folder, e.g. "/plugins/my-plugin" or "/.crosspoint/plugins/my-plugin". Always build paths from this; never hard-code the root.
- api.relay(method, url, headers?, body?): Outbound HTTP(S) through the reader -> {status, headers, body}
- api.fetchToSd(url, dest, headers?, options?): Download a URL straight to an SD path -> {status, bytes, complete, total}
- api.writeFile(path, base64): Write a small file (<= 256 KB) to SD -> {ok, bytes}
- api.crypto(op, fields): Device crypto primitives
- api.pluginFile(file): URL of a file in your plugin folder, for fetch, <img src>, <script src>
- api.registerAction(name, fn): Register a job-queue action (chapter 6)
There is also a global CrossPoint object with the same functions, which take an extra leading plugin argument (CrossPoint.relay(pluginName, method, ...)). Use api. It fills in your name for you.