Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backstage-grpc-playground

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backstage-grpc-playground

A frontend plugin for Backstage supporting gRPC playground

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
338
decreased by-14.86%
Maintainers
1
Weekly downloads
 
Created
Source

backstage-grpc-playground

GitHub Project Level GitHub issues GitHub contributors

  • Overview
  • Changelog
  • Requirements
  • Methods supported
  • Not supported
  • Install
  • Usage
  • Compare to BloomRPC
  • Yaml file definition
  • Examples
  • Acknowledgements

Overview

backstage-grpc-playground is a backstage plugin ported from BloomRPC which is an Electron application. We modified some of the original code to make this compatible with Backstage entity. See Compare to BloomRPC

This repo contains React frontend plugin. For the backend plugin, please checkout backstage-grpc-playground-backend

Changelog

View Full changelog

Requirements

  • Backstage ^1.5.0
  • Node.JS 14 | 16

Methods supported

  • Unary
  • Client streaming
  • Server streaming

Not supported (yet)

We are currently not supporting

Install

Install backstage-grpc-playground for packages/app

E.g: In your backstage project root

yarn --cwd packages/app add backstage-grpc-playground

Usage

Customize ApiDoc to use backstage-grpc-playground for grpc type
// packages/app/src/apis.ts
import { GrpcPlaygroundComponent } from 'backstage-grpc-playground';

// your code
// ...

export const apis: AnyApiFactory[] = [
  // other apis 
  // ...
  
  createApiFactory({
    api: apiDocsConfigRef,
    deps: {},
    factory: () => {
      // load the default widgets
      const definitionWidgets = defaultDefinitionWidgets();

      return {
        getApiDefinitionWidget: (apiEntity: ApiEntity) => {
          // custom rendering for grpc
          if (apiEntity.spec.type === 'grpc') {
            return {
              type: 'grpc',
              title: 'gRPC Playground',
              component: GrpcPlaygroundComponent
            }
          }
          
          // fallback to the defaults
          return definitionWidgets.find(d => d.type === apiEntity.spec.type);
        },
      };
    },
  }),
]
A path /grpc-playground in backstage application
// packages/app/src/App.tsx
import { GrpcPlaygroundPage } from 'backstage-grpc-playground'

// your code
// ...

const routes = (
  <FlatRoutes>
    // other routes 
    // ...
    <Route path="/grpc-playground" element={<GrpcPlaygroundPage />} />
  </FlatRoutes>
);

Example importing API definition from Github examples/yaml-definition/unary.yaml

import API

Compare to BloomRPC

Yaml file definition

See yaml-definition

Examples

View document

See example

Unary

call 1

See example

Stream

call 1

See example

Acknowledgements

Keywords

FAQs

Package last updated on 29 Aug 2022

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