React Native Cloud Storage

Introduction

iCloud and Google Drive for React Native.

React Native Cloud Storage allows you to use iCloud (iOS only) and Google Drive as file and data storage in your React Native app. Its API is intentionally developer-friendly, mirroring known tools like fs and AsyncStorage.

Features

  • File storage with fs-like API — readFile, writeFile, appendFile, readdir, mkdir, stat, unlink, and more, modeled on Node's fs so there's nothing new to learn.
  • Key-value storage — save preferences and small app state through native iCloud key-value storage or an emulated Google Drive store.
  • Two providers, one API — iCloud (via a native iCloud module) and Google Drive (via the REST API). Use the platform default or switch between them at runtime.
  • React hooks — useCloudFile, useCloudKV, and useIsCloudAvailable expose file content, key-value state, and provider availability.
  • Scopes — read and write in a hidden, app-private container (AppData) or the user-visible iCloud Drive / Google Drive Documents folder.
  • Expo config plugin — configures the native iCloud capability automatically, with no manual Xcode steps.
  • Built for the New Architecture — ships as a Turbo Module and is fully typed with TypeScript.

Quick example

import { CloudStorage, CloudKVStorage, CloudStorageScope } from 'react-native-cloud-storage';

// Write a file to the app-private scope (iCloud on iOS, Google Drive elsewhere).
await CloudStorage.writeFile('/data.txt', 'Hello, world!', CloudStorageScope.AppData);

// Or write to the key-value store (iCloud ubiquitous key-value store on iOS, Google Drive with emulated JSON file elsewhere)
await CloudKVStorage.setItem('theme', 'dark');

// Read it back later.
const helloWorld = await CloudStorage.readFile('/data.txt', CloudStorageScope.AppData); // 'Hello, world!'

const theme = await CloudKVStorage.getItem('theme'); // 'dark'

Prefer hooks? useCloudFile and useCloudKV wrap this into reactive values.

Provider & platform support

ProvideriOSAndroidWebNotes
iCloud✅——Uses iCloud Documents; requires native setup and an iCloud account.
Google Drive✅✅✅Backed by the Drive REST API; you provide an access token.

By default, the library picks the right provider for each platform: iCloud on iOS, Google Drive everywhere else. You can override this or even use both providers at once.

Get started

On this page