> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nelkap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> How Nelkap reaches your app, and how to add the route it calls in your framework.

Nelkap doesn't run your code on its own servers. Your workflows stay in your app, next to your database and your other code. Each time a run has work to do, Nelkap sends a POST request to your app, and the SDK runs the workflow right there.

That request arrives at your project's endpoint: one route that you add to your app and that passes each request to `nelkap.handle`. This section shows how to add that route in your framework, from the keys to your first run.

## Choose your framework

> **[Next.js](https://docs.nelkap.com/frameworks/nextjs.md)**
>
> A route handler in the App Router.

> **[React Router](https://docs.nelkap.com/frameworks/react-router.md)**
>
> A resource route, in framework mode.

> **[SvelteKit](https://docs.nelkap.com/frameworks/sveltekit.md)**
>
> A `+server.ts` endpoint.

> **[Nuxt](https://docs.nelkap.com/frameworks/nuxt.md)**
>
> A server route in the `server` folder.

> **[Astro](https://docs.nelkap.com/frameworks/astro.md)**
>
> An endpoint rendered on demand.

> **[Hono](https://docs.nelkap.com/frameworks/hono.md)**
>
> A route on a Hono app running on Node.js.

> **[Express](https://docs.nelkap.com/frameworks/express.md)**
>
> A route that turns Express's request into a standard one.

## Any other framework

`nelkap.handle` takes a standard web [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and returns a standard [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response). Any framework that gives you the incoming request in that form works the same way: add a POST route, and return what `handle` returns.

```ts theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import { nelkap } from './nelkap';

export const handleNelkap = async (
  request: Request,
): Promise<Response> => {
  return nelkap.handle(request);
};
```

The SDK needs Node.js 22 or later.

## What `handle` does

Each call from Nelkap carries the workflow to run, the run's payload, and the steps already saved. `handle` then does three things:

1. It checks that the call carries your project's secret. If it doesn't, it answers `401`, and nothing runs.
2. It looks for the workflow among the ones you registered. If your app doesn't have it, it answers `404`.
3. It answers `202` right away, then runs the workflow in the background, saving each step as it finishes.

Answering first means Nelkap never waits for your workflow, however long it takes.

## Serverless hosts

Hosts like Vercel can stop your code as soon as the response is sent. Since `handle` answers before the workflow runs, the run would stop with it. To keep it going, pass your host's `waitUntil` to `handle`:

```ts theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
export const handleNelkap = async (
  request: Request,
  waitUntil: (promise: Promise<unknown>) => void,
): Promise<Response> => {
  return nelkap.handle(request, {
    waitUntil: waitUntil,
  });
};
```

Each framework page shows the right `waitUntil` for its hosts.

## Before you deploy

Your endpoint must be a public HTTPS URL that answers without a sign-in. [Deploy your app](https://docs.nelkap.com/deploy/overview.md) lists what it needs, how Nelkap retries a call, and how your host's time limits play out.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.