Skip to main content
The @nomiq/node package is the official SDK for integrating Nomiq’s AI brand generation engine into Node.js applications. It wraps the Nomiq REST API with a fully typed interface, handles authentication, provides automatic retries, and includes built-in utilities for verifying webhook signatures — so you can focus on building rather than managing HTTP boilerplate.
1

Install the SDK

Add @nomiq/node to your project using your preferred package manager.
Store your API key in an environment variable (e.g., NOMIQ_API_KEY) and load it with a tool like dotenv. Never hardcode secrets directly in your source code or commit them to version control.
2

Initialize the Client

Import the Nomiq class and create a client instance by passing your API key. The client is the single entry point for every SDK method.
The SDK authenticates every request using the apiKey you pass to the constructor, attaching it as a Bearer token to the Authorization header automatically. All requests are routed to https://api.nomiq.com/v1.
3

Create a Project

Before you can generate a brand, you need a Project. Projects are top-level containers that store all generated assets, strategy data, and history nodes associated with a client or campaign.
A successful call returns a Project object. Save the project.id — you will need it to dispatch generation jobs.
4

Generate a Brand

Call nomiq.brands.generate() with your project_id and a semantic prompt describing the brand. Because AI generation is computationally intensive, this endpoint returns a 202 Accepted immediately with a job object. The final assets are delivered via webhook when the job completes.
The returned job object confirms the request was accepted:
5

Handle the Webhook

Configure a webhook endpoint in your Workspace Settings and listen for generation.success or generation.failed events. Nomiq signs every webhook request with an HMAC-SHA256 signature in the Nomiq-Signature header — always verify this before processing the payload.The example below shows a complete Express.js webhook handler. Note that express.raw() is required to access the raw request body for signature verification.

Projects

The nomiq.projects namespace exposes the full Projects API. Use these methods to manage your project containers programmatically.

Create a Project

Retrieve a Project

Fetch the details of any existing project by its ID.

List Projects

Returns all projects in your workspace, sorted newest-first. The response supports cursor-based pagination via limit and starting_after.

Delete a Project

Deleting a project is permanent and irreversible. All associated generated assets, history nodes, and memory data are immediately removed from the database.

Brand Generation

Dispatch a brand generation job by providing a project_id and a descriptive prompt. You can optionally override the webhook delivery URL on a per-request basis.
Generation jobs typically complete within 3–10 seconds. Do not poll the API for status — listen for the generation.success webhook event instead.

Handling Webhooks

Nomiq delivers the completed brand assets to your webhook endpoint via a POST request. The full webhook payload for a generation.success event contains the SVG markup, primary color hex value, and font family recommendation:
The memory_id field in the payload identifies the Memory Node created for this generation. Persist it alongside your job record — you can pass it back to nomiq.brands.generate() as the memory_id parameter to refine this brand in a future iteration rather than starting from scratch. Always return a 200 OK response within 5 seconds of receiving a webhook. Offload any heavy processing (database writes, image transforms, notifications) to an asynchronous queue such as BullMQ or a background worker. If Nomiq does not receive a 200 within the timeout window, it retries using an exponential backoff strategy.

TypeScript Support

The @nomiq/node SDK is written in TypeScript and ships with complete type definitions — no @types/ package required. Every method parameter, response shape, and error object is fully typed, giving you autocomplete and compile-time safety out of the box.

Error Handling

The SDK throws structured error objects when the API returns a non-2xx response. Wrap your calls in try/catch and inspect the error.code property to branch your error handling logic.

Python SDK

Use the official Nomiq Python SDK to integrate brand generation into automation pipelines and backend services.

API Reference

Explore the full REST API reference, including all endpoints, request parameters, and response schemas.