Evervault react native sdk
npm install @evervault/evervault-react-nativeor
yarn add @evervault/evervault-react-nativecd ios
pod install
cd ..
// .tsx
import { init, encrypt } from '@evervault/evervault-react-native';
export default function Component() {
const [encObject, setEncObject] = React.useState<string | undefined>();
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);
}, []);
}Initialize the Evervault SDK, this must be called before encrypt to set your Apps keys on the device.
| Type | Type | Required |
|---|---|---|
| teamUuid | string | yes |
| appUuid | string | yes |
Promise<void>
Encrypts data using Evervault Encryption.
To encrypt strings using the React Native SDK, simply pass a String or an Object into the encrypt() function.
| Type | Type | Required |
|---|---|---|
| data | String, Number, Object, Array | yes |
Promise<string>