Skip to content

Remove react-native-get-random-values dependency from cryptography package #3055

@venilinvasilev

Description

@venilinvasilev

Description

We need to remove the react-native-get-random-values dependency from our cryptography package.

Problem

This package was previously added as a workaround to ensure that users running @hashgraph/sdk in Expo or React Native environments would not need to manually import react-native-get-random-values at the root level (App.js/tsx). While this made initial integration easier for those users, it introduced an unintended side effect: our cryptography package, which should be strictly environment-agnostic, now includes React-specific dependencies.

This is problematic because:

  • It breaks the abstraction boundary — the cryptography package should have zero knowledge of whether it is being used in a Node, browser, or React Native context.
  • It unnecessarily pulls React Native dependencies into environments that don’t need them.
  • It causes issues with dependency trees, tree shaking, and potentially confuses consumers of the package.

Acceptance Criteria

  • Remove react-native-get-random-values from dependencies or peerDependencies.
  • Remove any import "react-native-get-random-values" statements from this package.
  • Update documentation to clearly state that React Native / Expo users must import react-native-get-random-values themselves before using the SDK.
  • Audit any other references or implicit assumptions about React Native within the cryptography package.

Notes

We acknowledge that this workaround was originally introduced with good intentions — to simplify the setup for users of the SDK on Expo. However, it's more important for the integrity and maintainability of our codebase to ensure proper separation of concerns. It’s better long-term to push this responsibility to the app layer.

Let’s get this fixed and keep our packages clean and environment-independent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions