links

Configure tRPC client link chains with httpLink, httpBatchLink, and wsLink.

Updated Jun 26, 2025
One-click install
npx skills add https://github.com/flaviogragnolati/coco --skill links-flaviogragnolati
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: links
Source: https://github.com/flaviogragnolati/coco/tree/main/.agents/skills/links
Command: npx skills add https://github.com/flaviogragnolati/coco --skill links-flaviogragnolati

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @trpc/client, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the complexity of managing tRPC client link chains by providing a structured approach to configuring and using different link types, such as httpLink, httpBatchLink, and wsLink, to enhance the performance and reliability of API calls.

Core Features & Use Cases

  • Link Configuration: Configure a wide range of link types including httpLink, httpBatchLink, httpBatchStreamLink, splitLink, loggerLink, wsLink, and more.
  • Terminating Links: Choose the appropriate terminating link to handle different types of API requests.
  • Subscription Routing: Route subscriptions efficiently with splitLink for seamless real-time updates.
  • Custom Links: Build custom links for advanced routing needs like service-oriented architecture (SOA).
  • Use Case: If you are developing a complex tRPC application that requires real-time updates, batch requests, and custom routing, this Skill can help you optimize your client setup.

Quick Start

Configure the tRPC client link chain using the provided template in SKILL.md and tailor it to your specific requirements.

Frequently Asked Questions about links

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

FAQPage Schema
How do I configure a tRPC client link chain for batch requests and real-time updates?

To configure a tRPC client link chain, you set up terminating links like httpBatchLink for grouped API calls and use splitLink to route subscriptions efficiently via wsLink for real-time updates. This structure enhances performance and custom routing.

What is the difference between httpLink and httpBatchLink in tRPC client setup?

In tRPC client setup, httpLink handles individual API requests sequentially, while httpBatchLink groups multiple API calls into a single network request. Choosing the right terminating link optimizes performance and manages network traffic effectively.

How do I route subscriptions using splitLink in a tRPC application?

You route subscriptions using splitLink by directing specific API operations to a wsLink for real-time updates while sending standard queries to an httpLink. This ensures efficient subscription handling within a single client configuration.

Can I build custom links for service-oriented architecture routing in tRPC?

Yes, you can build custom links to handle advanced routing needs like service-oriented architecture (SOA) in tRPC. This allows you to define specialized logic within your client link chain for complex application requirements.

When should I use httpBatchStreamLink over httpBatchLink for tRPC API calls?

You should use httpBatchStreamLink over httpBatchLink when your tRPC API calls require streaming responses. Both manage batched requests, but streaming links handle continuous data flows better for complex client setups.