Skip to main content
The RMZ Storefront SDK is a TypeScript-first, framework-agnostic library that wraps the Storefront API into a clean, type-safe interface. Use it with React, Vue, Angular, Svelte, or vanilla JavaScript in both client-side and server-side environments.

GitHub Repository

Source code, issues, and releases.

Next.js Starter

Full example storefront built with Next.js and the SDK.

Features

  • HMAC-SHA256 authentication with automatic signature generation for server-to-server requests
  • Firebase/Supabase-style query builder with intuitive method chaining
  • Universal compatibility — works in browsers, Node.js, Web Workers, and React Native
  • TypeScript first with full type safety and IntelliSense
  • Automatic retry, caching, and request deduplication
  • Singleton pattern for efficient resource usage
  • ~15 KB gzipped, zero external runtime dependencies, tree-shakeable

Installation

The current version is 2.1.2. The package is published as rmz-storefront-sdk on npm.

Quick Start

Client-side (browser)

On the client side, only a publicKey is needed. The default API URL points to https://front.rmz.gg/api.

Server-side (Node.js / SSR)

On the server, provide both publicKey and secretKey to enable HMAC-SHA256 authentication for every request.
Never expose your secretKey in client-side code. It must only be used in server-side environments (Node.js, SSR, API routes).

SDK Modules

The SDK exposes the following namespaces on the instance returned by createStorefrontSDK():

Environment Detection

The SDK automatically detects its runtime environment and adjusts behavior:
  • Browser: Uses X-Client-Auth header, warns if secretKey is present.
  • Node.js: Generates HMAC-SHA256 signatures on every request when secretKey is provided.
  • React Native: Treated as a browser environment.

Health Check

Verify API connectivity at any time:

Next Steps

Authentication

Understand the HMAC security model and key management.

Configuration

All configuration options, environment variables, and defaults.

Products

Query builder, search, and product retrieval.

Framework Guides

React, Vue, Angular, and vanilla JS examples.