{"id":30717043,"url":"https://github.com/serenity-kit/react-native-libsodium","last_synced_at":"2025-09-03T08:30:44.130Z","repository":{"id":64729878,"uuid":"572870944","full_name":"serenity-kit/react-native-libsodium","owner":"serenity-kit","description":"React Native bindings to Libsodium matching the libsodium-wrappers package API","archived":false,"fork":false,"pushed_at":"2024-10-25T08:50:48.000Z","size":28659,"stargazers_count":38,"open_issues_count":15,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-28T11:42:13.810Z","etag":null,"topics":["libsodium","react-native","sodium","type"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serenity-kit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2022-12-01T07:56:48.000Z","updated_at":"2025-08-13T17:11:51.000Z","dependencies_parsed_at":"2024-01-22T17:47:52.907Z","dependency_job_id":"1e8a966f-162c-46d6-8a39-07d49de30a6d","html_url":"https://github.com/serenity-kit/react-native-libsodium","commit_stats":null,"previous_names":["serenitynotes/react-native-libsodium"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/serenity-kit/react-native-libsodium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenity-kit%2Freact-native-libsodium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenity-kit%2Freact-native-libsodium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenity-kit%2Freact-native-libsodium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenity-kit%2Freact-native-libsodium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serenity-kit","download_url":"https://codeload.github.com/serenity-kit/react-native-libsodium/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serenity-kit%2Freact-native-libsodium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273413718,"owners_count":25101255,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["libsodium","react-native","sodium","type"],"created_at":"2025-09-03T08:30:38.574Z","updated_at":"2025-09-03T08:30:44.086Z","avatar_url":"https://github.com/serenity-kit.png","language":"TypeScript","readme":"# react-native-libsodium\n\nReact Native bindings to Libsodium matching the [libsodium-wrappers package](https://www.npmjs.com/package/libsodium-wrappers) API\n\nSupported Platforms:\n\n- iOS\n- Android\n- Web\n\nCurrently only a subset of the libsodium-wrappers exposed functionality is implemented. For missing functionality we welcome pull-requests or you can sponsor the development. Get in touch with us at `hi@serenity.re`.\n\n## Installation Expo (dev-client)\n\nThis package support the Expo plugin system and can be used together with the [Expo dev-client](https://docs.expo.dev/clients/introduction/).\n\n```sh\nnpm install react-native-libsodium\n```\n\nExtend app.config.js with the following plugins entry:\n\n```js\nexport default {\n  expo: {\n    …\n    plugins: [[\"react-native-libsodium\", {}]],\n  }\n}\n```\n\n## Installation React Native\n\n```sh\nnpm install react-native-libsodium\ncd ios \u0026\u0026 pod install\n```\n\n## Usage\n\n**Hint:** see the `example` app in the repository regarding how to use the functions\n\n```js\nimport {\n  crypto_auth,\n  crypto_auth_verify,\n  crypto_auth_BYTES,\n  crypto_auth_KEYBYTES,\n  crypto_auth_keygen,\n  crypto_aead_xchacha20poly1305_ietf_decrypt,\n  crypto_aead_xchacha20poly1305_ietf_encrypt,\n  crypto_aead_xchacha20poly1305_ietf_KEYBYTES,\n  crypto_aead_xchacha20poly1305_ietf_NPUBBYTES,\n  crypto_aead_xchacha20poly1305_ietf_keygen,\n  crypto_box_easy,\n  crypto_box_keypair,\n  crypto_box_seed_keypair,\n  crypto_box_open_easy,\n  crypto_box_PUBLICKEYBYTES,\n  crypto_box_SECRETKEYBYTES,\n  crypto_box_SEEDBYTES,\n  crypto_box_seal,\n  crypto_box_seal_open,\n  crypto_kdf_CONTEXTBYTES,\n  crypto_kdf_derive_from_key,\n  crypto_kdf_KEYBYTES,\n  crypto_kdf_keygen,\n  crypto_pwhash, // only with loadSumoVersion with react-native-web\n  crypto_pwhash_ALG_DEFAULT, // only with loadSumoVersion with react-native-web\n  crypto_pwhash_MEMLIMIT_INTERACTIVE, // only with loadSumoVersion with react-native-web\n  crypto_pwhash_OPSLIMIT_INTERACTIVE, // only with loadSumoVersion with react-native-web\n  crypto_pwhash_SALTBYTES, // only with loadSumoVersion with react-native-web\n  crypto_generichash,\n  crypto_generichash_BYTES,\n  crypto_generichash_BYTES_MIN,\n  crypto_generichash_BYTES_MAX,\n  crypto_generichash_KEYBYTES,\n  crypto_generichash_KEYBYTES_MIN,\n  crypto_generichash_KEYBYTES_MAX,\n  crypto_secretbox_easy,\n  crypto_secretbox_KEYBYTES,\n  crypto_secretbox_keygen,\n  crypto_secretbox_NONCEBYTES,\n  crypto_secretbox_open_easy,\n  crypto_sign_detached,\n  crypto_sign_keypair,\n  crypto_sign_SEEDBYTES,\n  crypto_sign_verify_detached,\n  from_base64,\n  randombytes_buf,\n  randombytes_uniform,\n  to_base64,\n  to_hex,\n  to_string,\n  ready, // only needed for react-native-web\n  loadSumoVersion, // only relevant for react-native-web\n  _unstable_crypto_kdf_hkdf_sha256_BYTES_MAX, // has no counterpart in libsodium-wrappers yet\n  _unstable_crypto_kdf_hkdf_sha256_BYTES_MIN, // has no counterpart in libsodium-wrappers yet\n  _unstable_crypto_kdf_hkdf_sha256_KEYBYTES, // has no counterpart in libsodium-wrappers yet\n  _unstable_crypto_kdf_hkdf_sha256_extract, // has no counterpart in libsodium-wrappers yet\n  _unstable_crypto_kdf_hkdf_sha256_expand, // has no counterpart in libsodium-wrappers yet\n} from 'react-native-libsodium';\n\n// ...\n```\n\n## React Native Web\n\nFor the web platform the constants and functions from the `libsodium-wrappers` package is exposed. This also means you need to wait for the `ready` Promise to be resolved before using any constant or function.\n\nCertain constants and functions e.g. `crypto_pwhash` are only available in the `libsodium-wrappers-sumo` package. To load this package instead for web you can call `loadSumoVersion` right after importing the package.\n\n```ts\nimport { loadSumoVersion, ready } from 'react-native-libsodium';\n\nloadSumoVersion();\n```\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n\nThe `to_string` function and `base64_variants` enum was copied from the libsodium.js project and you can find the license at [LICENSE_libsodiumjs](LICENSE_libsodiumjs).\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n\n## Acknowledgment\n\nThanks to [Donus](https://github.com/donus3) for freeing up the `react-native-libsodium` package name on npm.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserenity-kit%2Freact-native-libsodium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserenity-kit%2Freact-native-libsodium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserenity-kit%2Freact-native-libsodium/lists"}