Skip to content

Serializers

vRPC allows you to customize how data is serialized before it is sent to the server. By default, vRPC uses JSON.stringify, but you can extend this to handle special types.

Customizing JSON Serialization

You can provide your own serializer logic by modifying the generated rpc.mutator.ts.

Default Behavior

  • Dates: Converted to ISO strings.
  • Nulls: Preserved in the payload.
  • Circular References: Not supported (Standard JSON limitation).

Future Roadmap

We are working on a more robust serialization API that will allow for:

  • Automatic BigInt conversion.
  • FormData support for file uploads.
  • Custom transformer functions per-operation.

Released under the MIT License.