Authentication
RazCrypto uses two types of API keys. Always keep your secret key secure on your server.
Authentication Methods
| Key Type | Use Case | Security Level |
|---|---|---|
rz_pub_... Public Key | Frontend SDK, browser | โ Safe for client-side |
rz_sec_... Secret Key | Backend API, server-to-server | ๐ Server-side only |
Getting Your API Keys
- Login to RazCrypto Dashboard
- Navigate to Platforms section
- Click Add Platform or select existing
- Copy your Public Key and Secret Key
SDK Authentication (Frontend)
JavaScript
// Use Public Key in frontend โ safe!
RazCrypto.init({
public_key_id: "rz_pub_your_public_key_here"
});
API Authentication (Backend)
// Send in request header
X-Public-Key-Id: rz_pub_your_public_key_here
// Send both headers for server-to-server
X-Gateway-Id: your_gateway_id_here
X-Secret-Key: rz_sec_your_secret_key_here
Environment Variables
.env
# NEVER commit this file to version control
RAZ_PUBLIC_KEY=rz_pub_your_public_key_here
RAZ_SECRET_KEY=rz_sec_your_secret_key_here
RAZ_WEBHOOK_SECRET=your_webhook_secret_here
Never expose your secret key in client-side code! Always keep it in environment variables on your server.