DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsGetting StartedEnvironment Setup
Introduction
Getting Started
Our DashboardInstallationQuick StartAPI Keys & AuthenticationEnvironment SetupCommon Patterns
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
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

Environment Setup

Configure environment variables and project structure.

Updated March 29, 2026

On this page
  • Prerequisites
  • Create a Next.js Project
  • Install the SDK
  • Environment Variables
  • Initialize the Client
  • Verify the Connection
  • Recommended VS Code Extensions
  • Next Steps

Prerequisites

Before building with DashForDevs, make sure your development environment meets these requirements:

  • Node.js 18+ — We recommend the latest LTS version. Check with node --version
  • npm, yarn, or pnpm — Any modern package manager works
  • Next.js 14+ — Our SDK is optimized for Next.js App Router, but works with Pages Router and other React frameworks
  • A DashForDevs account — Sign up at the dashboard to get your API keys

Create a Next.js Project

If you are starting fresh, scaffold a new Next.js app:

shell
npx create-next-app@latest my-storefront --typescript --tailwind --app
cd my-storefront

Install the SDK

Add the DashForDevs SDK to your project:

shell
npm install github:CodeCraftStudios/dash4devs-sdk

See the full Installation guide for yarn/pnpm alternatives.

Environment Variables

Create a .env.local file in your project root with your API keys:

shell
# Public key — safe for client-side code
NEXT_PUBLIC_DASH4DEVS_API_KEY=pk_live_your_public_key_here

# Secret key — server-side ONLY
DASH4DEVS_SECRET_KEY=sk_live_your_secret_key_here
Important: Never prefix your secret key with NEXT_PUBLIC_. This would expose it to the browser. The SDK will throw an error if it detects this misconfiguration.

Initialize the Client

Create two client files — one for public operations, one for server-side:

typescript
// lib/dash.ts — Public client (browser-safe)
import { DashClient } from "dash4devs"

export const dash = new DashClient({
  apiKey: process.env.NEXT_PUBLIC_DASH4DEVS_API_KEY!,
})

export default dash
typescript
// lib/dash-server.ts — Server client (API routes, server components only)
import { DashClient } from "dash4devs"

export const dashServer = new DashClient({
  apiKey: process.env.DASH4DEVS_SECRET_KEY!,
})

Verify the Connection

Test that everything is wired up:

typescript
import dash from "@/lib/dash"

const { products } = await dash.products.list()
console.log(`Found ${products.length} products`)

If you see your products logged, your environment is ready.

Recommended VS Code Extensions

  • TypeScript — The SDK ships with full type definitions for autocomplete
  • Tailwind CSS IntelliSense — If using Tailwind for your storefront
  • ESLint — Catch common issues early

Next Steps

Your environment is set up. Continue to the Quick Start guide to build your first page, or review Common Patterns for best practices.

PreviousAPI Keys & AuthenticationNextCommon Patterns

On this page

  • Prerequisites
  • Create a Next.js Project
  • Install the SDK
  • Environment Variables
  • Initialize the Client
  • Verify the Connection
  • Recommended VS Code Extensions
  • Next Steps