Indy SDK Expo Plugin
Getting started | Contributing | License
An Expo Config Plugin to automatically set up and configure the Indy SDK for iOS & Android in React Native.
-
🧽 Clean and minimal repository as you don't need to commit yourios
andandroid
directories. -
⚡️ Super quick setup of the Indy SDK for iOS & Android in React Native. -
💰 Save hours of time by leveraging Expo's development tools and Expo Application Service.
With the Indy SDK Expo Plugin you can leverage the expo prebuild
command to generate the ios
and android
directories. This removes the need to following the tedious instructions for setting up the Indy SDK for react native, and means you don't need to commit the ios
and android
directories.
Note: The Expo Indy SDK Plugin has currently only be tested against Expo SDK 45.
Getting Started
Install the plugin using the following command:
# yarn
yarn add @animo-id/indy-sdk-expo-plugin
# npm
npm install -s @animo-id/indy-sdk-expo-plugin
Then add the plugin to your Expo app config (app.json
, app.config.json
or app.config.js
) plugins
array:
{
"expo": {
"plugins": ["@animo-id/indy-sdk-expo-plugin"]
}
}
And lastly, prebuild the application so the indy-sdk can be added as native dependency (If you aren't making any manual modification to the iOS and Android directories you can add them to the gitignore of your project and generate them on demand):
# yarn
yarn prebuid
# npm
npm run prebuild
That's it, you now have Indy SDK configured for your iOS and Android project. If you're using this plugin with Aries Framework JavaScript you will still need to follow the other setup steps, but you can skip the Installation for React Native.
Test if everything works
Add the indy-sdk-react-native
to your project:
# yarn
yarn add indy-sdk-react-native
# npm
npm install -s indy-sdk-react-native
Replace your app.js
with the following:
import { Button, StyleSheet, View } from "react-native";
import Indy from "indy-sdk-react-native";
export default function app() {
const testIndy = () => {
Indy.createWallet({ id: "sample-id" }, { key: "sample-key" })
.then(() => console.log("Success!"))
.catch((e) => console.error(`An error occurred! ${e}`));
};
return (
<View style={styles.container}>
<Button onPress={testIndy} title="test indy" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
Contributing
Is there something you'd like to fix or add? Great, we love community contributions! To get involved, please follow our contribution guidelines.
License
Indy SDK Plugin Expo is licensed under the Apache License Version 2.0 (Apache-2.0).