DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsSecurityAPI Key Security
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
API Key SecurityCORS & Allowed OriginsWebhook SignaturesCustomer DataRate Limiting
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

API Key Security

Best practices for storing and rotating API keys.

Updated March 29, 2026

On this page
  • Key Types
  • Best Practices
  • Rotating Keys
  • Next Steps

Key Types

PrefixAccess LevelSafe for Browser?
pk_*Read-only storefrontYes
sk_*Full admin accessNo — server only

Best Practices

  • Store keys in environment variables, never in source code
  • Use NEXT_PUBLIC_ prefix only for the public key
  • Never commit .env.local to version control
  • Rotate keys immediately if exposed
  • Use separate keys for development and production
The SDK prevents sk_* keys in browser environments. If you accidentally use a secret key client-side, the SDK will throw an error.

Rotating Keys

  1. Go to Settings → API Keys in the dashboard
  2. Generate a new key
  3. Update your environment variables
  4. Revoke the old key

Next Steps

  • CORS & Allowed Origins — Domain restrictions
  • API Keys & Authentication — Getting keys
PreviousConfiguring EmailNextCORS & Allowed Origins

On this page

  • Key Types
  • Best Practices
  • Rotating Keys
  • Next Steps