To start using Aries Framework JavaScript in NodeJS some platform specific dependencies are required.
- Install NodeJS (v12+) and Python 3
- Install Libindy for your platform.
- Add
@aries-framework/core
and@aries-framework/node
to your project.
yarn add @aries-framework/core @aries-framework/node
Initializing the Agent also requires some NodeJS specific setup, mainly for the Indy SDK and File System. Below is a sample config, see the README for an overview of getting started guides. If you want to jump right in, check the Getting Started: Agent guide.
import { Agent } from '@aries-framework/core'
import { agentDependencies } from '@aries-framework/node'
// This creates an agent with all the specified configuration data
const agent = new Agent(
{
label: 'my-agent',
walletConfig: {
id: 'walletId',
key: 'testkey0000000000000000000000000',
},
},
agentDependencies
)
// Make sure to initialize the agent before using it.
try {
await agent.initialize()
console.log('Initialized agent!')
} catch (error) {
console.log(error)
}