@digitalcredentials/data-integrity-rn
v1.0.2
Published
React Native polyfill for globals required for Data Integrity and VC apps (TextEncoder, crypto.subtle, etc).
Downloads
19
Readme
Data Integrity Polyfill for React Native (@digitalcredentials/data-integrity-rn)
React Native polyfill for globals required for Data Integrity and VC apps (TextEncoder, crypto.subtle, etc).
Table of Contents
Background
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)
Install
- Node.js 20+ is recommended.
NPM
To install via NPM:
npm install @digitalcredentials/data-integrity-rn
Development
To install locally (for development):
git clone https://github.com/digitalcredentials/data-integrity-rn.git
cd data-integrity-rn
npm install
Usage
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'
// ...
Contribute
PRs accepted.
If editing the Readme, please conform to the standard-readme specification.
License
MIT License © 2023 Digital Credentials Consortium.