Secure Init Migration
Migrating to Secure Init is now required for all apps moving forward. Please upgrade your app by 7/31/2025.
This migration is mandatory for continued access to Coinbase Onramp and Offramp APIs.
What is Secure Init?
Secure Init is an authentication method for Coinbase Onramp and Offramp that uses session tokens instead of passing the appId
and addresses
parameters directly in URLs. With Secure Init, you generate a session token on your backend server using your CDP API keys, then pass that token in the URL instead of including wallet addresses and other data as query parameters.
Migration Timeline
- June 27, 2025: Secure Init becomes the default behavior for all new apps
- July 31, 2025: Secure Init becomes mandatory for all existing apps
What Changes with Secure Init?
Without Secure Init
With Secure Init
Migration Steps
Step 1: Create a CDP Secret API Key
If you don’t already have one, create a Secret API Key in the CDP Portal:
- Navigate to your project’s API Keys tab
- Select the Secret API Keys section
- Click Create API key
- Configure your key settings (IP allowlist recommended)
- Download and securely store your API key
For Secure Init, you’ll need a Secret API Key (not a Client API Key) since session tokens must be generated server-side.
Step 2: Set Up JWT Authentication
To generate session tokens, you need to authenticate with CDP using JWT Bearer tokens. Follow the CDP API key authentication guide to set up JWT generation.
Step 3: Generate Session Tokens
Use the Session Token API to generate tokens for each user session:
Response:
Step 4: Update Your URLs
Replace your existing Onramp/Offramp URLs with the new session token format:
Onramp URL Examples
Before:
After:
Offramp URL Examples
Before:
After:
Step 5: Set Secure Init to enabled in your project on Portal
- Navigate to your project in Portal, and go to the Payments -> Onramp tab
- Toggle the Enforce secure initialization switch to Enabled
You’re all set! 🚀
Important Considerations
Session Token Properties
- Expiration: Session tokens expire after 5 minutes
- Single-use: Each token can only be used once
- Server-side generation: Must be generated on your backend server
URL Parameter Changes
When using session tokens, these parameters are no longer needed in the URL:
appId
(automatically included via session token)addresses
(included in session token generation)assets
(optional, can be included in session token generation)
These parameters can still be used:
defaultNetwork
defaultAsset
presetCryptoAmount
presetFiatAmount
defaultExperience
defaultPaymentMethod
fiatCurrency
handlingRequestedUrls
partnerUserId
redirectUrl
endPartnerName
Support and Resources
- Authentication Guide: CDP API Key Authentication
- Community Support: CDP Discord