Nimiq
Integrations

Nimiq Web Client Next.js Integration

Set up the Nimiq Web Client with Next.js for production-ready React blockchain applications.

Integrate Nimiq Web Client with Next.js for production-ready React blockchain applications.

Quick Start with Template

Get started instantly with our pre-configured Next.js starter:

Shell
npx degit onmax/nimiq-starter/starters/next-js my-nimiq-app
cd my-nimiq-app && pnpm install && pnpm dev
Community Contribution
The Next.js starter is based on the original implementation by DovAzencot.

Installation

Quick Start

Install the Nimiq Web Client package:

pnpm add @nimiq/core

Configuration & Usage

import path from 'node:path'

/** @type {import('next').NextConfig} */
const nextConfig = {
  webpack: (config, { isServer }) => {
    config.experiments = {
      ...config.experiments,
      asyncWebAssembly: true,
      topLevelAwait: true,
    }

    config.module.rules.push({
      test: /\.wasm$/,
      type: 'webassembly/async',
    })

    config.resolve = {
      ...config.resolve,
      alias: {
        ...config.resolve?.alias,
        '@nimiq/core': path.resolve('./node_modules/@nimiq/core/bundler/index.js'),
      },
      fallback: {
        ...config.resolve?.fallback,
        path: false,
        fs: false,
      },
      extensions: [...(config.resolve?.extensions || []), '.js', '.mjs'],
    }

    if (!isServer) {
      config.optimization = {
        ...config.optimization,
        splitChunks: {
          ...config.optimization?.splitChunks,
          cacheGroups: {
            ...(config.optimization?.splitChunks)?.cacheGroups,
            nimiq: {
              test: /@nimiq/,
              name: 'nimiq',
              chunks: 'all',
              priority: 10,
            },
          },
        },
      }
    }

    return config
  },
}

module.exports = nextConfig

Next steps

Once your client is connected, see the guides to start building. For other integration options, see Vite, Nuxt, ESM, or CommonJS.

Copyright © 2026