Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hzhu/node-provider-jwt
🔐 Node provider protection with JWTs in frontend dapps
https://github.com/hzhu/node-provider-jwt
alchemy dapp ethereum jwt quicknode-rpc
Last synced: about 2 months ago
JSON representation
🔐 Node provider protection with JWTs in frontend dapps
- Host: GitHub
- URL: https://github.com/hzhu/node-provider-jwt
- Owner: hzhu
- Created: 2024-10-13T04:05:59.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-12-09T00:00:06.000Z (about 2 months ago)
- Last Synced: 2024-12-09T00:28:41.988Z (about 2 months ago)
- Topics: alchemy, dapp, ethereum, jwt, quicknode-rpc
- Language: TypeScript
- Homepage: https://node-provider-jwt-alpha.vercel.app/
- Size: 339 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node Provider Protection with JWTs in Frontend dApps
[![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white&style=flat-square)](https://medium.com/@henballs/protecting-node-provider-urls-for-frontend-dapps-c9a8159fc94d)
[![Medium](https://img.shields.io/badge/Vercel-000000?style=for-the-badge&logo=vercel&logoColor=white&style=flat-square)](https://node-provider-jwt-alpha.vercel.app)This project demonstrates how to protect node provider API keys (e.g., for services like Alchemy) in frontend dApps using JWTs. By leveraging short-lived JWTs, we can securely manage access to node providers without exposing API keys directly in the frontend. For a detailed explanation, check out the [blog post](https://medium.com/@henballs/protecting-node-provider-urls-for-frontend-dapps-c9a8159fc94d) here, and see the solution in action in the [demo app](https://node-provider-jwt-alpha.vercel.app).
## Getting Started
Follow these steps to set up the project locally:
### Environment Variables
Create a `.env` file in the root of the project and add the following environment variables. You can find the explanations for these variables in the [blog post](https://medium.com/@henballs/protecting-node-provider-urls-for-frontend-dapps-c9a8159fc94d).
```bash
ALCHEMY_PRIVATE_KEY_PKCS8=
ALCHEMY_KEY_ID=
NEXT_PUBLIC_WC_PROJECT_ID=
```### Development Server
To run the application locally, run:
```bash
npm install
npm run dev
```