Skip to content

Quickstart

This runs the whole stack on one machine: Postgres, the API, one render worker and the web app. For production setups, see Self-hosting.

Follow Docker Compose › Start. The examples below assume the app is on http://localhost:8080.

Open the app and sign up. The first account becomes an admin.

Anyone who signs up after that has no roles, so they can sign in but do nothing until an admin grants a role under Admin > Users. See Concepts: roles.

Open Developers › Render playground. It takes the same request the API does, field by field: HTML, CSS, theme, header and footer, page options and Liquid data. Preview mode renders without logging. Rendering for real logs a generation you can find under Developers › My generations.

Under Developers › API keys, create a key with the render:html scope. Copy the secret (it starts with nd_); it’s shown once. For a system rather than a person, an admin can create a service account under Admin › Service accounts and give the key to it instead. See API keys and errors.

Terminal window
export NECODOC_API_KEY=nd_...
curl -H "x-api-key: $NECODOC_API_KEY" -H 'Content-Type: application/json' \
-d '{"html":"<h1>Hello {{ name }}</h1>","data":{"name":"world"}}' \
-o hello.pdf -D - \
http://localhost:8080/api/v1/render

The response headers include X-Generation-Id and X-Page-Count, and the render shows under Developers › My generations with your key’s name. Add "response":"json" to get the generation id and a download link instead of the bytes. See HTML to PDF.

Developers › API reference in the app lists every endpoint and can send requests with your key.