Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
react-native-couchbase-lite
Advanced tools
This package is not an official couchbase plugin and is not supported in any way by couchbase. If you have issues with it please do not use the couchbase forums but raise an issue here instead. Although this package does work as described it may not be fully featured and may not be suitable for your requirements. This package is just a thin layer over the CBL REST API, PRs and suggestions are welcome!
Couchbase Lite binding for react-native on both iOS and Android. It works by exposing some functionality to the native Couchbase Lite and the remaining actions are peformed via the REST API.
Create a new React Native project.
react-native init <project-name>
Navigate to your project directory and install the plugin.
cd <project-name>
npm install react-native-couchbase-lite --save
Link the native libraries.
react-native link react-native-couchbase-lite
Download the Couchbase Lite iOS SDK from here and drag CouchbaseLite.framework, CouchbaseLiteListener.framework, CBLRegisterJSViewCompiler.h, libCBLJSViewCompiler.a in the Xcode project.
Start React Native.
react-native start
Build and run for iOS/Android.
Note: If you wish to install the plugin from source, refer to the other installation options page.
In your app's entrypoint file, import the plugin and initialize the Couchbase Lite Listener.
import Couchbase from "react-native-couchbase-lite";
Couchbase.initRESTClient(manager => {
// use manager to perform operations
});
The manager is the Couchbase Lite entrypoint to perform different operations.
The full API is derived from the Couchbase Lite Swagger spec.
The API is self documented through the help()
method. You can print the list of tags for an endpoint.
Couchbase.initRESTClient(manager => {
// use manager to perform operations
manager.help(); // prints all tags and endpoints
});
Once you know the kind of operation to perform, you can print all the endpoints available on a particular tag.
Couchbase.initRESTClient(manager => {
// use manager to perform operations
manager.database.help(); // prints all endpoints for the database tag
});
End finally drill down on a particular endpoint for the operation you wish to perform.
Couchbase.initRESTClient(manager => {
// use manager to perform operations
manager.database.put_db.help(); // prints the list of parameters for PUT /{db}
});
As you can see, there are two parameters to provide (db and body). The same exact parameters are documented on the /{db}}/_bulk_docs endpoint.
FAQs
Install Couchbase Lite in your app to enable JSON sync.
The npm package react-native-couchbase-lite receives a total of 26 weekly downloads. As such, react-native-couchbase-lite popularity was classified as not popular.
We found that react-native-couchbase-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.