Other frameworks
✓ 1 minute setup
Easy

FeedbackJar + Astro

FeedbackJar integrates with Astro via a script tag in your base layout. Works with static sites, SSR mode, and any Astro UI framework (React, Vue, Svelte, Solid).

Get your Widget ID free → 7-day free trial · No credit card required

How to install FeedbackJar in Astro

1

Get your Widget ID

bash
# Sign up at app.feedbackjar.com
# Create a widget → copy your Widget ID
2

Add to your base Layout.astro

astro
---
// src/layouts/Layout.astro
const { feedbackjarId } = Astro.locals; // optional: pass from middleware
---
<html>
  <body>
    <slot />

    <script src="https://cdn.feedbackjar.com/sdk.js"></script>
    <script define:vars={{ widgetId: import.meta.env.PUBLIC_FEEDBACKJAR_ID }}>
      window.fj.init(widgetId);
    </script>
  </body>
</html>

Uses Astro's define:vars directive to pass env variables into inline scripts.

3

Add Widget ID to .env

bash
# .env
PUBLIC_FEEDBACKJAR_ID=your_widget_id
4

Identify users (optional, for SSR mode)

astro
---
// src/layouts/Layout.astro
import { getUser } from '../lib/auth';
const user = await getUser(Astro.request);
---
<script define:vars={{ user, widgetId: import.meta.env.PUBLIC_FEEDBACKJAR_ID }}>
  window.fj.init(widgetId);
  if (user) {
    window.fj.identify({ id: user.id, email: user.email });
  }
</script>

What you get

  • Works with Astro static and SSR modes
  • Uses define:vars for env variable injection
  • Compatible with any Astro UI framework
  • No JS framework required
  • User identification in SSR layouts
  • Minimal bundle impact

Add feedback to your Astro app today

Sign up free, grab your Widget ID, and have the feedback widget running in your Astro app in 1 minute.

Start Free Trial 7-day free trial · No credit card required

Frequently Asked Questions

Looking for the full technical reference? Read the Astro docs →