{"id":4696,"url":"https://github.com/couchbaselabs/react-native-couchbase-lite","last_synced_at":"2025-08-04T01:33:04.443Z","repository":{"id":57336264,"uuid":"46100490","full_name":"couchbaselabs/react-native-couchbase-lite","owner":"couchbaselabs","description":"Couchbase Lite binding for React Native Android \u0026 iOS","archived":true,"fork":false,"pushed_at":"2022-04-12T00:09:15.000Z","size":10463,"stargazers_count":111,"open_issues_count":30,"forks_count":54,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-07-30T05:18:18.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/couchbaselabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-13T04:44:31.000Z","updated_at":"2024-07-30T05:18:18.057Z","dependencies_parsed_at":"2022-09-11T12:20:41.427Z","dependency_job_id":null,"html_url":"https://github.com/couchbaselabs/react-native-couchbase-lite","commit_stats":null,"previous_names":["fraserxu/react-native-couchbase-lite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbaselabs%2Freact-native-couchbase-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbaselabs%2Freact-native-couchbase-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbaselabs%2Freact-native-couchbase-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/couchbaselabs%2Freact-native-couchbase-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/couchbaselabs","download_url":"https://codeload.github.com/couchbaselabs/react-native-couchbase-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228582488,"owners_count":17940587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:20.553Z","updated_at":"2024-12-07T08:30:51.982Z","avatar_url":"https://github.com/couchbaselabs.png","language":"Java","funding_links":[],"categories":["Components"],"sub_categories":["Storage"],"readme":":warning: This repo is obsolete.  It is no longer maintained and is based on a version of Couchbase Lite that reached end of life years ago.  Please see the [new version](https://github.com/couchbaselabs/couchbase-lite-react-native-module) of this repo for more up to date information.\n\n# react-native-couchbase-lite\n\n**NOTE:** This plugin works for Couchbase Lite 1.x only. For new projects, we recommend to use the [Couchbase Lite 2.0 Native API](https://developer.couchbase.com/documentation/mobile/2.0/couchbase-lite/index.html)  and to write your own wrapper to access Couchbase Lite APIs from a JavaScript codebase (see https://facebook.github.io/react-native/docs/communication-ios.html).\n\n## Disclaimer\n\n_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\nthe couchbase forums** but raise an issue [here](https://github.com/couchbaselabs/react-native-couchbase-lite/issues) instead.  Although\nthis 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 \nlayer over the CBL REST API, PRs and suggestions are welcome!_\n\n* [Installation](#installation)\n* [Getting Started](#getting-started)\n* [Documentation](#documentation)\n\nCouchbase 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.\n\n## Installation\n\n1. Create a new React Native project.\n\n\t```bash\n\treact-native init \u003cproject-name\u003e\n\t```\n\n2. Navigate to your project directory and install the plugin.\n\n\t```bash\n\tcd \u003cproject-name\u003e\n\tnpm install react-native-couchbase-lite --save\n\t```\n\n3. Link the native libraries.\n\n\t```\n\treact-native link react-native-couchbase-lite\n\t```\n\n\t#### iOS only\n\n\tDownload the Couchbase Lite iOS SDK from [here](http://www.couchbase.com/nosql-databases/downloads#) and drag **CouchbaseLite.framework**, **CouchbaseLiteListener.framework**, **CBLRegisterJSViewCompiler.h**, **libCBLJSViewCompiler.a** in the Xcode project.\n\n\t![](http://cl.ly/image/3Z1b0n0W0i3w/sdk.png)\n\t\nMake sure these files can be resolved via **Framework Search Paths** in the XCODE projects **Build settings**, either by adding them to one of the mentioned directories or adding a new location in the list.\n\n4. Start React Native.\n\n\t```bash\n\treact-native start\n\t```\n\n5. Build and run for iOS/Android.\n\n\u003e **Note:** If you wish to install the plugin from source, refer to the [other installation options](https://github.com/couchbaselabs/react-native-couchbase-lite/wiki/Other-Installation-Options) page.\n\n## Getting Started\n\nIn your app's entrypoint file, import the plugin and initialize the Couchbase Lite Listener.\n\n```js\nimport Couchbase from \"react-native-couchbase-lite\";\n\nCouchbase.initRESTClient(manager =\u003e {\n\t// use manager to perform operations\n});\n```\n\nThe manager is the Couchbase Lite entrypoint to perform different operations.\n\n## Documentation\n\nThe full API is derived from the [Couchbase Lite Swagger spec](http://developer.couchbase.com/documentation/mobile/current/references/couchbase-lite/rest-api/index.html).\n\nThe API is self documented through the `help()` method. You can print the list of tags for an endpoint.\n\n```javascript\nCouchbase.initRESTClient(manager =\u003e {\n\t// use manager to perform operations\n\tmanager.help();    // prints all tags and endpoints\n});\n```\n\n![](https://cl.ly/0M2L2S2M1j1s/tags.png)\n\nOnce you know the kind of operation to perform, you can print all the endpoints available on a particular tag.\n\n```javascript\nCouchbase.initRESTClient(manager =\u003e {\n\t// use manager to perform operations\n\tmanager.database.help();    // prints all endpoints for the database tag\n});\n```\n\n![](https://cl.ly/3d1H281z1c1W/database.png)\n\nEnd finally drill down on a particular endpoint for the operation you wish to perform.\n\n```javascript\nCouchbase.initRESTClient(manager =\u003e {\n\t// use manager to perform operations\n\tmanager.database.put_db.help(); // prints the list of parameters for PUT /{db}\n});\n```\n\n![](https://cl.ly/070z08081W0X/bulk_docs.png)\n\nAs you can see, there are two parameters to provide (**db** and **body**). The same exact parameters are documented on the [/{db}}/_bulk_docs](http://developer.couchbase.com/documentation/mobile/current/references/couchbase-lite/rest-api/index.html#!/database/post_db_bulk_docs) endpoint.\n\n## Publishing to npm\n\n1. Bump the version number in **package.json**.\n2. Run `npm publish` locally (it will fail if you don't access rights to publish to npm for this module).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbaselabs%2Freact-native-couchbase-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcouchbaselabs%2Freact-native-couchbase-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcouchbaselabs%2Freact-native-couchbase-lite/lists"}