2024-07-22 14:16:36 +00:00
---
id: grpc
title: gRPC
---
< div className = 'badge badge--primary heading-badge' > Self-hosted only< / div >
:::caution
2024-09-13 13:09:59 +00:00
Only self-hosted deployments will have access to a gRPC datasource that is capable of handling unary requests and responses.
2024-07-22 14:16:36 +00:00
:::
2024-09-13 13:09:59 +00:00
< div style = {{paddingTop:'24px'}} >
2024-07-22 14:16:36 +00:00
## Setup
2024-09-13 13:09:59 +00:00
### Step 1: Upgrade ToolJet to the Version 2.5 or Above
2024-07-22 14:16:36 +00:00
2024-09-13 13:09:59 +00:00
Find instructions on how to do this in the setup guides located here: [ToolJet Setup ](/docs/setup/ ).
2024-07-22 14:16:36 +00:00
2024-09-13 13:09:59 +00:00
### Step 2: Add Proto Files
2024-07-22 14:16:36 +00:00
2024-09-13 13:09:59 +00:00
At the root, create a directory named "*protos*" and add a "*service.proto*" file inside it.
2024-07-22 14:16:36 +00:00
### Step 3: Mount Volumes
2024-09-13 13:09:59 +00:00
In the **docker-compose.yml** add the following to the *volumes* sections for **plugins** and **server**
2024-07-22 14:16:36 +00:00
```bash
./protos:/app/protos
```
< img className = "screenshot-full" src = "/img/datasource-reference/grpc/proto1.png" alt = "gRPC: datasource" width = '500' / >
< img className = "screenshot-full" src = "/img/datasource-reference/grpc/proto2.png" alt = "gRPC: datasource" width = '500' / >
2024-09-13 13:09:59 +00:00
### Step 4: Reboot the Instance
2024-07-22 14:16:36 +00:00
```bash
docker-compose up -d
```
2024-09-13 13:09:59 +00:00
< / div >
< div style = {{paddingTop:'24px'}} >
2024-07-22 14:16:36 +00:00
## Querying gRPC
After setting up your proto files, you should be able to establish a connection to gRPC by going to the [global datasource ](/docs/data-sources/overview ) page.
2024-09-13 13:09:59 +00:00
### Connect the gRPC Datasource
2024-07-22 14:16:36 +00:00
ToolJet requires the following to connect to gRPC servers:
- **Server URL**
2024-09-13 13:09:59 +00:00
- **Authentication type**
- None
- Basic
- Bearer
- API key
2024-07-22 14:16:36 +00:00
< div style = {{textAlign: ' center ' } } >
< img className = "screenshot-full" src = "/img/datasource-reference/grpc/connection.png" alt = "gRPC: connection" / >
< / div >
Once you have added the gRPC from the global datasource page, you'll find it on the query panel of the application.
< div style = {{textAlign: ' center ' } } >
< img className = "screenshot-full" src = "/img/datasource-reference/grpc/grpcgds.png" alt = "gRPC: connection" / >
< / div >
2024-09-13 13:09:59 +00:00
### Creating Query
2024-07-22 14:16:36 +00:00
You can now query a particular RPC method of the added services.
< div style = {{textAlign: ' center ' } } >
< img className = "screenshot-full" src = "/img/datasource-reference/grpc/query.png" alt = "gRPC: connection" / >
2024-09-13 13:09:59 +00:00
< / div >
< / div >