Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 1.49 KB

setup-nodejs.md

File metadata and controls

46 lines (37 loc) · 1.49 KB

Setup NodeJS

Prerequisites

To start using Aries Framework JavaScript in NodeJS some platform specific dependencies are required.

  1. Install NodeJS (v12+) and Python 3
  2. Install Libindy for your platform.
  3. Add @aries-framework/core and @aries-framework/node to your project.
yarn add @aries-framework/core @aries-framework/node

Agent Setup

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)
}