superjson

Apply SuperJSON transformer to tRPC server and client links to preserve non-JSON data.

2|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/PlazaCC/antes-da-tela --skill superjson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: superjson
Source: https://github.com/PlazaCC/antes-da-tela/tree/main/.agents/skills/superjson
Command: npx skills add https://github.com/PlazaCC/antes-da-tela --skill superjson

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures Date, Map, Set, BigInt and other non-JSON types travel safely between server and client in tRPC by applying SuperJSON transformer.

Core Features & Use Cases

  • Automatically apply SuperJSON transformer on server and client links.
  • Preserve non-JSON types like Date, Map, Set, BigInt during TRPC RPC calls.
  • Use Case: Ensure seamless cross-environment data serialization for complex payloads.

Quick Start

Configure the SuperJSON transformer on both server initTRPC and every client link to ensure complex data travels correctly across TRPC.

Frequently Asked Questions about superjson

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preserve Date and Map objects in tRPC client-server calls?

To preserve Date and Map objects in tRPC, apply a SuperJSON transformer to both the server initTRPC.create configuration and every terminating client link, ensuring non-JSON data types travel safely across network calls.

Why do my tRPC Date objects convert to strings after network requests?

tRPC Date objects convert to strings because standard JSON serialization lacks type preservation. Applying a SuperJSON transformer on both server and client links resolves this by retaining the original non-JSON data types across the network boundary.

What non-JSON data types does SuperJSON support for tRPC serialization?

SuperJSON supports tRPC serialization for non-JSON data types including Date, Map, Set, BigInt, and RegExp, ensuring these complex objects maintain their types during client-server RPC calls.

Do I need to configure the SuperJSON transformer on both the tRPC server and client?

Yes, you must configure the SuperJSON transformer on both the tRPC server and client. Enforcing consistency across server initTRPC and every client link, including httpBatchLink, httpLink, and wsLink, prevents common integration pitfalls.

Can I use SuperJSON with tRPC websocket links?

Yes, you can use SuperJSON with tRPC websocket links. The transformer applies to wsLink alongside httpBatchLink and httpLink, ensuring complex payloads like Set and BigInt maintain data integrity across all client terminating links.