{"id":15136625,"url":"https://github.com/appwrite/sdk-for-react-native","last_synced_at":"2026-02-13T15:18:21.281Z","repository":{"id":226371133,"uuid":"768499057","full_name":"appwrite/sdk-for-react-native","owner":"appwrite","description":"[READ ONLY] Official Appwrite React Native SDK 💙 ⚛︎","archived":false,"fork":false,"pushed_at":"2025-05-12T07:14:44.000Z","size":375,"stargazers_count":4310,"open_issues_count":3,"forks_count":30,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-12T13:16:04.474Z","etag":null,"topics":["appwrite","baas","javascript","react-native","typescript"],"latest_commit_sha":null,"homepage":"https://appwrite.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appwrite.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-07T07:40:59.000Z","updated_at":"2025-05-12T12:30:04.000Z","dependencies_parsed_at":"2024-03-26T03:27:19.400Z","dependency_job_id":"5683f01f-83fa-4620-8cdd-bc8d01ed6712","html_url":"https://github.com/appwrite/sdk-for-react-native","commit_stats":{"total_commits":47,"total_committers":7,"mean_commits":6.714285714285714,"dds":"0.34042553191489366","last_synced_commit":"4d06993a7ba8148db507a89276389edd3814b9ce"},"previous_names":["appwrite/sdk-for-react-native"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appwrite","download_url":"https://codeload.github.com/appwrite/sdk-for-react-native/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745196,"owners_count":21957319,"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":["appwrite","baas","javascript","react-native","typescript"],"created_at":"2024-09-26T06:40:18.267Z","updated_at":"2026-02-13T15:18:21.270Z","avatar_url":"https://github.com/appwrite.png","language":"TypeScript","readme":"# Appwrite React Native SDK\n\n![License](https://img.shields.io/github/license/appwrite/sdk-for-react-native.svg?style=flat-square)\n![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square)\n[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)\n[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee\u0026label=twitter\u0026style=flat-square)](https://twitter.com/appwrite)\n[![Discord](https://img.shields.io/discord/564160730845151244?label=discord\u0026style=flat-square)](https://appwrite.io/discord)\n\n**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-react-native/releases).**\n\nAppwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the React Native SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)\n\n![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)\n\n## Installation\n\nTo install\n\n```bash\nnpx expo install react-native-appwrite react-native-url-polyfill\n```\n\n\n## Getting Started\n\n### Add your Platform\n\nIf this is your first time using Appwrite, create an account and create your first project.\n\nThen, under **Add a platform**, add a **Android app** or a **Apple app**. You can skip optional steps.\n\n#### iOS steps\n\nAdd your app **name** and **Bundle ID**. You can find your **Bundle Identifier** in the **General** tab for your app's primary target in XCode. For Expo projects you can set or find it on **app.json** file at your project's root directory.\n\n#### Android steps\nAdd your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level **build.gradle** file. For Expo projects you can set or find it on **app.json** file at your project's root directory.\n\n## Setup\n\nOn `index.js` add import for `react-native-url-polyfill`\n\n```\nimport 'react-native-url-polyfill/auto'\n```\n\n\u003e If you are building for iOS, don't forget to install pods\n\u003e `cd ios \u0026\u0026 pod install \u0026\u0026 cd ..`\n\n### Init your SDK\n\nInitialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page.\n\n```js\nimport { Client } from 'react-native-appwrite';\n// Init your React Native SDK\nconst client = new Client();\n\nclient\n    .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint\n    .setProject('455x34dfkj') // Your project ID\n    .setPlatform('com.example.myappwriteapp') // Your application ID or bundle ID.\n;\n```\n\n### Make Your First Request\n\nOnce your SDK object is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.\n\n```js\nconst account = new Account(client);\n\n// Register User\naccount.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')\n    .then(function (response) {\n        console.log(response);\n    }, function (error) {\n        console.log(error);\n    });\n\n```\n\n### Full Example\n\n```js\nimport { Client, Account } from 'react-native-appwrite';\n// Init your React Native SDK\nconst client = new Client();\n\nclient\n    .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint\n    .setProject('455x34dfkj')\n    .setPlatform('com.example.myappwriteapp') // YOUR application ID\n;\n\nconst account = new Account(client);\n\n// Register User\naccount.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')\n    .then(function (response) {\n        console.log(response);\n    }, function (error) {\n        console.log(error);\n    });\n```\n\n### Type Safety with Models\n\nThe Appwrite React Native SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a generic type parameter that allows you to specify your custom model type for full type safety.\n\n**TypeScript:**\n```typescript\ninterface Book {\n    name: string;\n    author: string;\n    releaseYear?: string;\n    category?: string;\n    genre?: string[];\n    isCheckedOut: boolean;\n}\n\nconst databases = new Databases(client);\n\ntry {\n    const documents = await databases.listDocuments\u003cBook\u003e(\n        'your-database-id',\n        'your-collection-id'\n    );\n    \n    documents.documents.forEach(book =\u003e {\n        console.log(`Book: ${book.name} by ${book.author}`); // Now you have full type safety\n    });\n} catch (error) {\n    console.error('Appwrite error:', error);\n}\n```\n\n**JavaScript (with JSDoc for type hints):**\n```javascript\n/**\n * @typedef {Object} Book\n * @property {string} name\n * @property {string} author\n * @property {string} [releaseYear]\n * @property {string} [category]\n * @property {string[]} [genre]\n * @property {boolean} isCheckedOut\n */\n\nconst databases = new Databases(client);\n\ntry {\n    /** @type {Models.DocumentList\u003cBook\u003e} */\n    const documents = await databases.listDocuments(\n        'your-database-id',\n        'your-collection-id'\n    );\n    \n    documents.documents.forEach(book =\u003e {\n        console.log(`Book: ${book.name} by ${book.author}`); // Type hints available in IDE\n    });\n} catch (error) {\n    console.error('Appwrite error:', error);\n}\n```\n\n**Tip**: You can use the `appwrite types` command to automatically generate TypeScript interfaces based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation).\n\n### Error Handling\n\nThe Appwrite React Native SDK raises an `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching the exception and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.\n\n```javascript\ntry {\n    const user = await account.create(ID.unique(), \"email@example.com\", \"password\", \"Walter O'Brien\");\n    console.log('User created:', user);\n} catch (error) {\n    console.error('Appwrite error:', error.message);\n}\n```\n\n### Learn more\n\nYou can use the following resources to learn more and get help\n- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/quick-starts/react-native)\n- 📜 [Appwrite Docs](https://appwrite.io/docs)\n- 💬 [Discord Community](https://appwrite.io/discord)\n- 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native)\n\n\n## Contribution\n\nThis library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.\n\n## License\n\nPlease see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappwrite%2Fsdk-for-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappwrite%2Fsdk-for-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappwrite%2Fsdk-for-react-native/lists"}