How to add Encryption with @realm/react

I am using @realm/react which uses useRealm() a react hook instead of

How do I add encryption using Realm when I do not use at all?

This is official guide for adding encryption.

@Milkshake encryptionKey is a property of the realm configuration. With @realm/react you can configure this to your realm in two ways:

  • provide it in the configuration given to createRealmProvider
createRealmProvider({schema:[...], encryptionKey:...})
  • add it as a prop to the RealmProvider (this can override specific configuration attributes provided previously in createRealmProvider)
const Root = () => {
  return (<RealmProvider encryptionKey={...}>
1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.