New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@connectrpc/connect-web

Package Overview
Dependencies
Maintainers
6
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@connectrpc/connect-web

Connect is a family of libraries for building and consuming APIs on different languages and platforms. [@connectrpc/connect](https://www.npmjs.com/package/@connectrpc/connect) brings type-safe APIs with Protobuf to TypeScript.

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
decreased by-98.22%
Maintainers
6
Weekly downloads
 
Created

What is @connectrpc/connect-web?

@connectrpc/connect-web is a package designed to facilitate the use of gRPC-web, a protocol that allows for the use of gRPC in web applications. It provides tools for creating and managing gRPC-web clients, enabling communication between web applications and gRPC services.

What are @connectrpc/connect-web's main functionalities?

Creating a gRPC-web client

This code demonstrates how to create a gRPC-web client using @connectrpc/connect-web. It imports necessary functions and a service definition, sets up a transport with a base URL, and creates a client for the specified service.

import { createConnectTransport, createPromiseClient } from '@connectrpc/connect-web';
import { MyService } from './gen/my_service_connectweb';

const transport = createConnectTransport({
  baseUrl: 'https://my-grpc-service.com',
});

const client = createPromiseClient(MyService, transport);

Making a gRPC call

This code shows how to make a gRPC call using the client created with @connectrpc/connect-web. It calls a method on the client with a request object and logs the response.

async function fetchData() {
  const response = await client.myMethod({
    requestParam: 'value'
  });
  console.log(response);
}

fetchData();

Other packages similar to @connectrpc/connect-web

FAQs

Package last updated on 09 Jan 2025

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc