Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
react-native-couchbase-lite
Advanced tools
Couchbase Lite binding for react-native on both iOS and Android.
$ npm install react-native-couchbase-lite --save
From the Link Binary With Libraries
section in the Build Phases
of the top-level project, add the following frameworks in your Xcode project (they are dependencies for Couchbase Lite)
Download the Couchbase Lite iOS SDK from here and drag CouchbaseLite.framework, CouchbaseLiteListener.framework, CBLRegisterJSViewCompiler.h and libCBLJSViewCompiler.a in the Xcode project.
android/settings.gradle
...
include ':react-native-couchbase-lite'
project(':react-native-couchbase-lite').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-couchbase-lite/android')
android/build.gradle
allprojects {
repositories {
mavenLocal()
jcenter()
// add couchbase url
maven {
url "http://files.couchbase.com/maven2/"
}
}
}
android/app/build.gradle
apply plugin: 'com.android.application'
android {
...
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.facebook.react:react-native:0.12.+'
// Add this line:
compile project(':react-native-couchbase-lite')
}
Register module in MainActivity.java
import me.fraserxu.rncouchbaselite.*; // <--- import
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new ReactCBLiteManager()) // <------- here
.addPackage(new MainReactPackage())
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "MyApp", null);
setContentView(mReactRootView);
}
In your app entry, init and start the Couchbase Lite Listener
import {manager, ReactCBLite} from 'react-native-couchbase-lite'
// init the Listener with a port and login credentials
ReactCBLite.init(5984, 'admin', 'password')
// instantiate a new database
var database = new manager('http://admin:password@localhost:5984/', 'myapp');
database.createDatabase()
.then((res) => {
database.getAllDocuments()
.then((res) => {
this.setState({
dataSource: this.state.dataSource.cloneWithRows(res.rows)
});
});
See the example project for a more in-depth use case.
promise database.createDatabase();
promise database.createDesignDocument(string designDocumentName, object designDocumentViews);
promise database.createDocument(object json);
promise database.getDesignDocument(string designDocumentName);
promise database.queryView(string designDocumentName, string viewName);
promise database.deleteDocument(string documentId, string documentRevision);
promise database.getAllDocuments();
promise database.getDocument();
promise database.replicate(string source, string target, boolean continuous);
void database.listen();
MIT
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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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.