What it enables
Connecting Coinbase enables crypto-related widgets:- Crypto Price Widgets: Display real-time prices for BTC, ETH, SOL, and other cryptocurrencies
- Price Charts: View historical price data with multiple timeframes (1h, 24h, 1w, 1m, 3m, 6m, 1y)
- Currency Lists: Browse all available cryptocurrencies on Coinbase Exchange
- Custom Watchlists: Track your favorite crypto assets
This integration uses the Coinbase Exchange API (also known as Coinbase Pro API), which is different from the retail Coinbase API.
Setup Instructions
Create a Coinbase Account
- Sign up for a Coinbase account if you don’t have one
- Complete identity verification if required
- Navigate to Coinbase Exchange (Coinbase Pro)
Generate API Keys
- Log into Coinbase Exchange
- Navigate to API settings
- Click New API Key
- Configure the API key:
- Nickname:
Forge Dashboard(or your preferred name) - Passphrase: Create a secure passphrase (you’ll need this)
- Permissions: Select View (read-only access is sufficient)
- Nickname:
- Click Create API Key
- Save your API Key, API Secret, and Passphrase
Add Environment Variables
Add the following variables to your
.env file:Despite the variable names using “CLIENT_ID” and “CLIENT_SECRET”, these correspond to your Coinbase API Key and API Secret respectively. The passphrase is included in the secret for Forge’s implementation.
Authentication Method
Coinbase Exchange uses HMAC-SHA256 authentication rather than traditional OAuth. Forge handles this automatically:- For each API request, Forge generates a timestamp
- Creates a signature using your API Secret (base64-decoded)
- Includes the signature in request headers:
CB-ACCESS-KEY: Your API KeyCB-ACCESS-SIGN: HMAC signatureCB-ACCESS-TIMESTAMP: Request timestampCB-ACCESS-PASSPHRASE: Your API passphrase
All authentication is handled server-side. Your API credentials never leave your Forge instance.
Available Features
Fetch Crypto Prices
Forge can fetch real-time and historical price data for any trading pair on Coinbase Exchange:- Default pairs: BTC-USD, ETH-USD, SOL-USD
- Custom pairs: Any valid Coinbase trading pair (e.g., DOGE-USD, MATIC-USD)
- Timeframes: 1h, 24h, 1w, 1m, 3m, 6m, 1y
- Current price (latest close)
- Percent change over the timeframe
- OHLC (Open, High, Low, Close) candlestick data
Browse Currencies
Fetch a list of all available cryptocurrencies:- Filters to show only “online” cryptocurrencies
- Sorted alphabetically by currency ID
- Includes currency name and ID
API Endpoints Used
Forge makes requests to these Coinbase Exchange API endpoints:GET /products/{product-id}/candles- Fetch historical price candlesGET /currencies- List all available currencies
https://api.exchange.coinbase.com
Rate Limits
Coinbase Exchange API has rate limits:- Public endpoints: 3 requests per second
- Private endpoints: 5 requests per second
cache: "no-store") to ensure fresh data while respecting rate limits.
Troubleshooting
Invalid Signature Error
If you see “Invalid signature” errors:- Verify your
COINBASE_CLIENT_SECRETis the base64-encoded API Secret from Coinbase - Ensure your API Key (
COINBASE_CLIENT_ID) is correct - Check that your system clock is synchronized (signatures are time-sensitive)
Unauthorized / 401 Errors
If requests fail with 401 Unauthorized:- Confirm your API Key has View permissions enabled
- Verify the API Key is still active in Coinbase Exchange settings
- Check that you’re using the Exchange API credentials, not regular Coinbase API credentials
Unable to Load Price Data
If price data fails to load:- Verify the trading pair exists on Coinbase Exchange (e.g., “BTC-USD”)
- Check that the API endpoints are accessible from your server
- Review your application logs for specific error messages
Missing Currencies
If certain currencies don’t appear:- Only “online” crypto currencies are shown
- The currency must be available on Coinbase Exchange
- Some currencies may be delisted or temporarily offline
Security Best Practices
Data Privacy
The Coinbase integration:- Does not require personal trading data access
- Only fetches public market data
- Operates entirely server-side within your Forge instance
- Does not share data with third parties
Since this integration uses view-only access to public market data, no sensitive financial information is accessed or stored.