Indy SDK
Indy SDK provides a distributed ledger based foundation for self-sovereign identity. It can provide the Wallet
and StorageService
implementations for the agent, as well as a way to interact with Indy ledgers and an implementation of the legacy (v0.1) AnonCreds Specification
The Indy SDK integration in Aries Framework JavaScript is currently in maintenance mode. We recommend new projects to use Aries Askar from the start, and also to migrate existing projects to Aries Askar.
The AnonCreds implementation from the Indy SDK only supports the Hyperledger Indy Legacy AnonCreds Method (the pre-standardized implementation), and doesn't support the new Ledger Agnostic AnonCreds Specification (v1.0). Use the new AnonCreds Rust implementation, which is also supported by Aries Framework JavaScript, in combination with Aries Askar and Indy VDR to replace the bevhaviour of the Indy SDK, and support the new features these libraries have to offer.
Installing the Indy SDK
When using Aries Framework JavaScript with the Indy SDK, there's a few extra dependencies that need to be installed. We need to install the @aries-framework/indy-sdk
package, which implements the needed interfaces for the agent. Secondly, we need to install the native Indy SDK library and the bindings for our specific platform. Currently there are bindings for Node.JS and React Native.
To start off, install the native Indy SDK library. The setup for this depends on the platform you are using. Follow the instructions for your platform below.
📄️ Linux
To install Indy SDK on Linux, a couple of dependencies are required. This guide covers the installation for the more popular Linux distributions.
📄️ Windows
To install Indy SDK on Windows, you can download the pre-built binary from the Sovrin repository.
📄️ macOS (Intel)
To install Indy SDK on macOS a couple of dependencies are required. This guide covers the installation of the Indy SDK for macs with an Intel processor. For installing the Indy SDK on ARM based macs, please refer to the Indy SDK macOS (ARM) guide.
📄️ macOS (ARM)
To install Indy SDK on macOS, a couple of dependencies are required. This guide covers the installation of the Indy SDK for macs with an ARM processor. For installing the Indy SDK on Intel based macs, please refer to the Indy SDK macOS (Intel) guide.
📄️ React Native
The setup of Indy SDK for React Native is rather different than Node.JS. We do not have to install dependencies on the host-platform, but for the build target. For React Native this would be the Indy SDK for Android & iOS. This guide covers both the Android and iOS setup, as in most React Native projects you will need both.
After the native Indy SDK library is installed, we can add the Indy SDK libraries.
- Node.JS
- React Native
yarn add @aries-framework/indy-sdk@^0.4.0 indy-sdk
And install the needed types
yarn add --dev @types/indy-sdk
yarn add @aries-framework/indy-sdk@^0.4.0 indy-sdk-react-native
And then install the needed types
yarn add --dev @types/indy-sdk-react-native@npm:@types/indy-sdk
Adding the Indy SDK to the Agent
After installing the dependencies, we can register the Indy SDK Module on the agent.
- Node.JS
- React Native
import { Agent } from '@aries-framework/core'
import { agentDependencies } from '@aries-framework/node'
import { IndySdkModule } from '@aries-framework/indy-sdk'
import indySdk from 'indy-sdk'
const agent = new Agent({
config,
dependencies: agentDependencies,
modules: {
// Register the Indy SDK module on the agent
indySdk: new IndySdkModule({
indySdk,
}),
},
})
import { Agent } from '@aries-framework/core'
import { agentDependencies } from '@aries-framework/react-native'
import { IndySdkModule } from '@aries-framework/indy-sdk'
import indySdk from 'indy-sdk-react-native'
const agent = new Agent({
config,
dependencies: agentDependencies,
modules: {
// Register the Indy SDK module on the agent
indySdk: new IndySdkModule({
indySdk,
}),
},
})