React Native polyfill for globals required for Data Integrity and VC apps (TextEncoder, crypto.subtle, etc).
There are several global objects such as TextEncoder
and crypto
that are
present in Node.js and most browsers, but not in React Native.
This is a polyfill for these objects, which exports the following globals:
TextEncoder
andTextDecoder
crypto
andcrypto.subtle
(WebCryptography API)
- Node.js 20+ is recommended.
To install via NPM:
npm install @digitalcredentials/data-integrity-rn
To install locally (for development):
git clone https://github.com/digitalcredentials/data-integrity-rn.git
cd data-integrity-rn
npm install
When developing for React Native and using various Digital Bazaar or DCC provided
libraries such as jsonld
or
@digitalcredentials/vc
,
make sure to import this polyfill before importing the libraries:
import '@digitalcredentials/data-integrity-rn'
// Now you can import various libraries
import '@digitalcredentials/vc'
// ...
PRs accepted.
If editing the Readme, please conform to the standard-readme specification.
MIT License © 2023 Digital Credentials Consortium.