Skip to content

Storage plugin: add an adapter for react-native-keychain #562

Description

@alexprigi

Description

The Storage plugin can inspect MMKV, AsyncStorage and Expo SecureStore, but not items stored with react-native-keychain (iOS Keychain / Android Keystore). That library is widely used in bare React Native apps, where expo-secure-store isn't available.

Suggested solution

Add a react-native-keychain adapter next to the existing ones, written in the same style as the Expo SecureStore adapter. Unlike SecureStore, react-native-keychain can list its own services, so users wouldn't need to supply a key list.

Additional context

I have a working prototype in my own app, on iOS and Android, with react-native-keychain 10 and Rozenite 2.5.0. If this fits the project, I'd test it properly in the playground and open a PR once it's ready, with tests, docs and a changeset. Would you accept it, and is there anything about the design you'd want to settle first?

Activity

  1. V3RON commented on Oct 15, 2026

    @V3RON
    Contributor

    Hey @alexprigi!

    Go ahead and open a PR. It should be pretty straightforward, as the only thing needed is to map the API expected by Rozenite to whatever the library exposes.

    The only thing you need to worry about is making sure it doesn't crash when the library is missing.

  2. alexprigi commented on Oct 16, 2026

    @alexprigi
    ContributorAuthor

    Thanks @V3RON! I opened a PR for this: #563.

    It follows the Expo SecureStore adapter: the react-native-keychain module is passed in (createKeychainStorageAdapter({ keychain: Keychain })), so the plugin never imports it. Loading the plugin can't fail when the library is missing, and if keychain is undefined the adapter just exposes no storages.

    Services are listed with getAllGenericPasswordServices, so no key list is needed. I tried it in the playground on an iOS simulator and an Android emulator (list, edit, add, delete, import, export).

    Happy to change anything in the API or naming if you'd prefer it differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions