trpc-client-devtools-link
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

tRPC Client Devtools Link

A neat link to use the tRPC Client Devtools extension with your tRPC app

This link lets your app communicate with the tRPC Client Devtools extension. You can download it for Chrome or Firefox.

Installation

npm install trpc-client-devtools-link

Example

import { devtoolsLink } from "trpc-client-devtools-link"
...
links: [
  devtoolsLink({
    // `enabled` is true by default
    // If you want to use the devtools extension just for development, do the following
    enabled: process.env.NODE_ENV === 'development'
  }),
  httpLink({
    url,
  })
],
...

Requirements

Peer dependencies:

  • tRPC Client v9 (@trpc/client@^9.27.2) must be installed.
  • tRPC Server v9 (@trpc/server@^9.27.2) must be installed.

Credits

  • This link is a modified version of the original loggerLink implemented in tRPC. You can check it out here.
  • This library took heavily from the concepts to communicate between a library and a Chrome extension found in this article from Patrick Desjardins.

/trpc-client-devtools-link/

    Package Sidebar

    Install

    npm i trpc-client-devtools-link

    Weekly Downloads

    4,631

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    6.29 kB

    Total Files

    8

    Last publish

    Collaborators

    • rhen28