I'm trying to connect with a running PocketBase database. Normally, I would use their Javascript SDK to achieve this, but the package does not get shipped to the mobile device during the build process. This means I either have to build my own set of functions to mimic the working of the PocketBase Javascript SDK, or use a NativeScript plugin.
I could not find an existing plugin mentioning PocketBase, does anyone know of a plugin that facilitates this?
I tried to install the PocketBase Javascript SDK directly from NPM using npm install pocketbase
, but this module does not check shipped to the mobile device during the build process.
For example:
import PocketBase from 'pocketbase'
console.dir(PocketBase)
Running this from a NativeScript app logs "null" to the console.
Using
import * as PocketBase from 'pocketbase'
ended up working for me. I installed the pocketbase SDK withnpm i --save pocketbase
.For whatever reason using
import PocketBase from 'pocketbase'
as the PocketBase documentation suggests doesn't work in this case.