Skip to content

Multi-Spec Registry

vRPC is designed for microservice architectures where a single frontend might need to communicate with multiple independent APIs.

How it works

The specs dictionary in vrpc.yaml allows you to define multiple clients with unique names.

yaml
specs:
  api:
    specPath: './core.json'
    outputDir: 'src/vrpc/core'
  payments:
    specPath: './stripe.json'
    outputDir: 'src/vrpc/stripe'

Generated Structure

vRPC will generate a dedicated set of files (rpc.schema.ts, rpc.proc.ts, rpc.map.ts) for each entry in separate directories. This prevents naming collisions between your APIs.

Optimization

The Zero-Runtime Plugin is aware of all these names. It will independently optimize calls to api.method() and payments.operation() by using the correct metadata map for each call site.

Released under the MIT License.