RPC agent

circle-check

An RPC agent exposes its collections to the main agent via RPC protocol.

Installation

Add the gem to your Gemfile:

gem 'forest_admin_rpc_agent'

Then run:

bundle install

Run the installation command with the auth_secret from your main Forest Admin project:

forest_admin_rpc_agent install YOUR_AUTH_SECRET

This command will:

  • Create config/initializers/forest_admin_rpc_agent.rb (configuration file with auth secret)

  • Create lib/forest_admin_rpc_agent/create_rpc_agent.rb (agent configuration)

  • Mount the RPC routes in config/routes.rb

circle-info

By default, the RPC datasource uses your Forest Admin project's auth_secret. If you specify a custom auth_secret when installing the RPC agent, make sure to use the same value in your main agent's RPC datasource configuration.

Configuration

The generated lib/forest_admin_rpc_agent/create_rpc_agent.rb file contains:

Customizing collections

You can use all standard customization methods on your RPC agent collections.

Adding a computed field

Adding an action

Adding a segment

circle-info

For advanced use cases like defining relations between collections from different RPC agents, see Advanced usage.

Last updated