> For the complete documentation index, see [llms.txt](https://docs.viesus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.viesus.com/use-cases/nodejs-saas.md).

# Node.js SaaS Integration

**The scenario:** A SaaS platform lets users upload images that are enhanced in the background and made available to download. The service must handle many concurrent uploads without blocking, and keep enhancement off the main request path.

***

## Recommended interface

{% hint style="info" %}
Use the [**VIESUS Node.js module**](/reference/node.js-module/overview.md). It calls the enhancement engine **in-process** from Node.js via a worker thread pool, so enhancement runs off the main event loop without the overhead of launching an external process per image.
{% endhint %}

Choose this over the CLI when enhancement is part of a running Node.js service rather than a batch job. If you'd rather not host infrastructure at all, the [Cloud API](/use-cases/cloud-api-integration.md) offers the same engine over HTTP.

***

## How it works

* The native module loads the VIESUS library inside your Node.js process. A pool of worker threads each holds one reusable enhancement instance, so requests are processed in parallel without blocking the event loop.
* A typical service accepts an upload, hands the image to the pool, stores the enhanced result, and returns a link the user can retrieve — all asynchronously.
* The same `viesusini.json` you tuned in the Viewer drives the enhancement, so results match your other interfaces.

***

## What to consider

| Factor              | Guidance                                                                                                                                               |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Platform**        | The Node.js module is **Linux only**, and AI features need an NVIDIA driver with CUDA 12.6+. See [System Requirements](/installation/requirements.md). |
| **Concurrency**     | Size the worker pool to your CPU cores (or GPUs). Cap the queue so the service rejects early under overload rather than piling up.                     |
| **Licensing**       | The GUID is passed at runtime — keep it in an environment variable or secrets manager, never in source.                                                |
| **Output handling** | Clean up enhanced files on a TTL; don't rely on per-request deletion.                                                                                  |
| **Resilience**      | Set timeouts for very large images and track latency and queue depth.                                                                                  |
| **Deployment**      | Containerize for production — see [Docker Production Deployment](/use-cases/docker-production.md).                                                     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.viesus.com/use-cases/nodejs-saas.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
