Files
twenty/packages/twenty-apps/examples/document-generator
nitin 79f3a5243a Add callAppRoute to RestApiClient (#22863)
Adds a `callAppRoute` method to `RestApiClient` in
`twenty-client-sdk/rest`. It calls one of the app's own HTTP routes
using the injected `TWENTY_FUNCTIONS_URL`, resolved internally the same
way the client already resolves `TWENTY_API_URL`, so app code no longer
reads env vars or knows how function routes are hosted.

Both app runtimes already go through `RestApiClient` for route calls
(logic functions and front components), so both get this in one place;
front components keep the existing 401 token-refresh flow.

Pairs with #22825, which makes the injected `TWENTY_FUNCTIONS_URL`
callable in every topology (app custom domain -> workspace isolated
functions domain -> `SERVER_URL/s`).

Once this ships in an SDK release, Call Recorder's own-route plumbing
(logic-function and front-component utils) drops its URL resolution and
calls `client.callAppRoute(path, body)`.

---------

Co-authored-by: martmull <martmull@hotmail.fr>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-07-15 18:07:16 +00:00
..

Document Generator

Turn your CRM data into finished documents — in one click.

What you get

  • Reusable templates — write once with {{placeholders}} like {{name.firstName}} or {{company.name}}
  • Generate anywhere — from the command menu on a record, a workflow step, or AI chat
  • Polished PDFs — every document is saved to the record with a downloadable PDF
  • Shareable links — open any document as a standalone, printable web page
  • Native rich-text editor — author templates in the same editor as Notes and Tasks

📌 Heads up

  • Free to run — generation uses no external API, so there's no per-document charge.
  • A hands-on reference — this is the app built in the Document Generator tutorial, a tour through most of the Twenty SDK.