https://github.com/evervault/evervault-react-native-sdk
https://github.com/evervault/evervault-react-native-sdk
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/evervault/evervault-react-native-sdk
- Owner: evervault
- License: mit
- Created: 2024-01-31T15:47:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-21T13:48:48.000Z (about 2 years ago)
- Last Synced: 2024-05-21T15:07:34.000Z (about 2 years ago)
- Language: TypeScript
- Size: 2.51 MB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# react-native-evervault-sdk
Evervault react native sdk
## Installation
```sh
npm install @evervault/evervault-react-native
```
or
```sh
yarn add @evervault/evervault-react-native
```
## Setup iOS + React Native v0.60
```
cd ios
pod install
cd ..
```
## Usage
```typescript
// .tsx
import { init, encrypt } from '@evervault/evervault-react-native';
export default function Component() {
const [encObject, setEncObject] = React.useState();
const testEncObject = { key: 'value', boolKey: true, number: 123};
React.useEffect(() => {
async function initEvervault() {
try {
await init('TEAM_UUID', 'APP_UUID');
} catch (error) {
console.error(error);
}
}
initEvervault();
encrypt(testEncObject).then(setEncObject);
}, []);
}
```
## Reference
### `init(teamUuid, appUuid)`
Initialize the Evervault SDK, this must be called before `encrypt` to set your Apps keys on the device.
### Options
| Type | Type | Required |
| ------- | -------- | -------- |
| teamUuid| string |yes |
| appUuid| string |yes |
### Returns
`Promise`
### `encrypt(data)`
Encrypts data using [Evervault Encryption](https://docs.evervault.com/security/evervault-encryption).
To encrypt strings using the React Native SDK, simply pass a String or an Object into the `encrypt()` function.
### Options
| Type | Type | Required |
| ------- | -------- | -------- |
| data| String, Number, Object, Array |yes |
### Returns
`Promise`