DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsGetting StartedInstallation
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

Installation

Install the DashForDevs SDK via npm and configure your project.

Updated March 29, 2026

On this page
  • Install the SDK
  • Set Up Environment Variables
  • Initialize the Client
  • Verify It Works
  • Project Structure
  • TypeScript Support
  • Next Steps

Install the SDK

Install the DashForDevs SDK directly from GitHub:

npm install github:CodeCraftStudios/dash4devs-sdk

Or with yarn:

yarn add github:CodeCraftStudios/dash4devs-sdk

Set Up Environment Variables

Create a .env.local file in your project root:

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

# Secret key — server-side ONLY (API routes, server components)
# NEVER prefix with NEXT_PUBLIC_
DASH4DEVS_SECRET_KEY=sk_live_your_secret_key_here
Warning: Never put your secret key (sk_*) in a NEXT_PUBLIC_ variable. The SDK will throw an error if it detects this, but prevention is better than detection.

Initialize the Client

Create a file at lib/dash.ts (or lib/dash.js):

import { DashClient } from "dash4devs"

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

export default dash

For server-side operations that need write access (creating orders, updating customers), create a separate server client:

// lib/dash-server.ts — ONLY import this in server components / API routes
import { DashClient } from "dash4devs"

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

Verify It Works

Test the connection in any page or component:

import dash from "@/lib/dash"

// Fetch products
const { products } = await dash.products.list()
console.log(products)

If you see your products logged, you are good to go.

Project Structure

Recommended file structure for a DashForDevs storefront:

my-storefront/
  app/
    layout.tsx
    page.tsx              # Home page
    products/
      page.tsx            # Product listing
      [slug]/page.tsx     # Product detail
    cart/page.tsx          # Cart page
    checkout/page.tsx      # Checkout
    account/
      page.tsx            # Customer account
      orders/page.tsx     # Order history
    blog/
      page.tsx            # Blog listing
      [slug]/page.tsx     # Blog post
  lib/
    dash.ts               # Public client (pk_*)
    dash-server.ts        # Server client (sk_*)
  components/
    ProductCard.tsx
    CartDrawer.tsx
    Header.tsx
    Footer.tsx
  .env.local              # API keys (git-ignored)

TypeScript Support

The SDK ships with full TypeScript definitions. All methods, parameters, and return types are typed. No additional @types package needed.

Next Steps

Now that the SDK is installed, head to the Quick Start guide to build your first page, or check API Keys & Authentication to understand the key types.

PreviousOur DashboardNextQuick Start

On this page

  • Install the SDK
  • Set Up Environment Variables
  • Initialize the Client
  • Verify It Works
  • Project Structure
  • TypeScript Support
  • Next Steps