# NestJS (https://talivia.com/docs/installation-guides/nest-js)



NestJS can serve templates or a separate frontend. Add Talivia wherever the browser HTML shell is created.




## Server-rendered templates [#server-rendered-templates]

Place the snippet in the shared layout or template before the closing `</body>` tag.

```html
<main>
  <!-- page content -->
</main>
<script defer src="https://talivia.com/script.js" data-website-id="YOUR_WEBSITE_ID"></script>
</body>
```

## API-only apps [#api-only-apps]

If NestJS only serves an API, install Talivia in the frontend app instead, such as Next.js, React, Angular, or Vue.

Replace the website ID. Copy it from Talivia Settings -> Tracking for the public website.

Open the public app and verify the first session in Talivia.
