Skip to content

Commit

Permalink
feat: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ieow committed Dec 12, 2023
1 parent 43f94eb commit fd1b613
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,47 @@ npm install react-native-tss-lib
```

## Usage
1. Install requried peer dependency
https://github.com/torusresearch/react-native-tss-lib/blob/4cf28633cb5c066c7237821441e4d6497e3041d4/package.json#L87

2. configure metro.config
https://github.com/inokawa/react-native-react-bridge#1-fix-metroconfigjs-to-use-babeltransformer-from-this-library

3.

```js
import { TssLibView } from "react-native-tss-lib";
import { Bridge } from "react-native-tss-lib";
import * as TssLibRN from "react-native-tss-lib";
import {
Web3AuthMPCCoreKit,
} from '@web3auth/mpc-core-kit';

class ReactStorage implements IAsyncStorage {
async getItem(key: string): Promise<string | null> {
return EncryptedStorage.getItem(key);
}

async setItem(key: string, value: string): Promise<void> {
return EncryptedStorage.setItem(key, value);
}
}
const coreKitInstancelocal = new Web3AuthMPCCoreKit({
web3AuthClientId: 'torus-key-test',
web3AuthNetwork: WEB3AUTH_NETWORK.DEVNET,
uxMode: 'react-native',
asyncStorageKey: new ReactStorage(),
tssLib: TssLibRN,
});

// ...

<TssLibView color="tomato" />
<View>
<Bridge />
...
<View>
```


## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
Expand Down

0 comments on commit fd1b613

Please sign in to comment.