Skip to content

Commit b984a38

Browse files
authored
add note about usage in react native (openwallet-foundation#186)
Signed-off-by: Timo Glastra <[email protected]>
1 parent e40a53b commit b984a38

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Aries Framework JavaScript is a framework for building SSI Agents and DIDComm se
2020
- [Prerequisites](#prerequisites)
2121
- [Installing](#installing)
2222
- [Using the framework](#using-the-framework)
23+
- [Usage in React Native](#usage-in-react-native)
2324
- [Logs](#logs)
2425
- [Architecture](#architecture)
2526
- [Development](#development)
@@ -82,6 +83,33 @@ yarn add file:PATH_TO_REPOSITORY_FOLDER/aries-framework-javascript/aries-framewo
8283

8384
While the framework is still in early development the best way to know what API the framework exposes is by looking at the [tests](src/lib/__tests__), the [source code](src/lib) or the [samples](./src/samples). As the framework reaches a more mature state, documentation on the usage of the framework will be added.
8485

86+
### Usage in React Native
87+
88+
The framework is designed to be usable in multiple environments. The indy-sdk is the only dependency that needs special handling and is therefore an parameter when initializing the agent. Alongside Aries Framework JavaScript you need to install the indy-sdk for the environment you're using.
89+
90+
```sh
91+
# for NodeJS
92+
yarn install indy-sdk
93+
94+
# for React Native
95+
yarn install rn-indy-sdk
96+
```
97+
98+
The when initializing the agent you can pass the specific Indy API as an input parameter:
99+
100+
```typescript
101+
// for NodeJS
102+
import indy from 'indy-sdk';
103+
104+
// for React Native
105+
import indy from 'rn-indy-sdk';
106+
107+
// Pass indy to agent
108+
agent = new Agent(config, inboundTransport, outboundTransport, indy);
109+
```
110+
111+
For an example react native app that makes use of the framework see [Aries Mobile Agent React Native](https://github.com/animo/aries-mobile-agent-react-native.git)
112+
85113
### Logs
86114

87115
If you want the framework to show the logs while running, you can set the `DEBUG=aries-framework-javascript` debug environment variable. For running the sample mediator this means running `yarn prod:debug` instead of `yarn prod:start`

0 commit comments

Comments
 (0)