🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

connect-devtools

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-devtools

A Connect interceptor to enable viewing requests in gRPC-Web Devtools.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

ConnectRPC Devtools Interceptor

This package contains a ConnectRPC interceptor that will forward information to the gRPC-Web DevTools extension, allowing you to easily debug the contents of ConnectRPC requests. Which the gRPC-Web DevTools extension ships with its own interceptor for Connect V1, that interceptor crashes when used with Connect V2. This package only supports Connect V2.

Install:

npm install connect-devtools

Add it to your Connect client:

import { createPromiseClient, type Interceptor } from "@connectrpc/connect";
import { createConnectTransport } from "@connectrpc/connect-web";
import { devtoolsInterceptor } from 'connect-devtools';

const interceptors: Interceptor[] = [
  // whatever other interceptors you want
];

// Only install the devtools interceptor if the gRPC-Web Devtools extension is available
if ("window" in globalThis && "__CONNECT_WEB_DEVTOOLS__" in globalThis.window) {
  interceptors.push(devtoolsInterceptor);
}

const transport = createConnectTransport({
  baseUrl: endpoint,
  interceptors,
});

const client = createPromiseClient(definition, transport);

Development

  • pnpm start - build the package
  • pnpm test - test the package
  • TODO: GitHub workflow to publish the package
  • TODO: Tests

Keywords

connectrpc

FAQs

Package last updated on 09 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts