@credo-ts/action-menu
TypeScript icon, indicating that this package has built-in type declarations

0.5.15 • Public • Published


Credo Logo

Credo Action Menu Module

License typescript @credo-ts/action-menu version


Action Menu module for Credo. Implements Aries RFC 0509.

Quick start

In order for this module to work, we have to inject it into the agent to access agent functionality. See the example for more information.

Example of usage

import { ActionMenuModule } from '@credo-ts/action-menu'

const agent = new Agent({
  config: {
    /* config */
  },
  dependencies: agentDependencies,
  modules: {
    actionMenu: new ActionMenuModule(),
    /* other custom modules */
  },
})

await agent.initialize()

// To request root menu to a given connection (menu will be received
// asynchronously in a ActionMenuStateChangedEvent)
await agent.modules.actionMenu.requestMenu({ connectionId })

// To select an option from the action menu
await agent.modules.actionMenu.performAction({
  connectionId,
  performedAction: { name: 'option-1' },
})

Readme

Keywords

none

Package Sidebar

Install

npm i @credo-ts/action-menu

Weekly Downloads

398

Version

0.5.15

License

Apache-2.0

Unpacked Size

118 kB

Total Files

96

Last publish

Collaborators

  • openwalletfoundation
  • timoglastra