Skip to main content

Important Security Note

Never use API keys directly in React. API keys will be exposed to all website visitors in the browser. Always use a backend proxy.

Insecure Pattern (Don’t do this)

Backend Proxy Setup

First, create a backend API that proxies requests to Byul:

Node.js/Express Backend

React Examples

Basic News Component

News Hook with Filtering

Real-time News Dashboard

Portfolio News Tracker

Next.js Integration

API Route (Next.js 13+ App Router)

React Server Component (Next.js 13+)

Environment Setup

Create React App

Next.js

Testing

Production Deployment

Environment Variables:
Security Checklist:
  • API key only in backend environment
  • CORS properly configured
  • Rate limiting on proxy endpoints
  • Input validation on all parameters
  • Error messages don’t expose internal details

CSS Styling Example