RevDock | Docs
Installation Guides

Astro

Add RevDock to your Astro site in under 2 minutes.

Works with both static (SSG) and server-rendered (SSR) Astro sites.

Setup

Open your base layout

Find your main layout file, usually at src/layouts/Layout.astro or src/layouts/BaseLayout.astro.

Add the script to head

Insert the RevDock script inside the <head> tag:

---
// Your frontmatter
---

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width" />
    <script
      defer
      src="https://getrevdock.com/scripts/revdock.js"
      data-website-id="YOUR_WEBSITE_ID"
    ></script>
  </head>
  <body>
    <slot />
  </body>
</html>

Deploy

Push your changes. RevDock will be active on your next build.

Using environment variables

Store your website ID in .env:

PUBLIC_REVDOCK_ID=your_website_id

Then use it in your layout:

<script
  defer
  src="https://getrevdock.com/scripts/revdock.js"
  data-website-id={import.meta.env.PUBLIC_REVDOCK_ID}
></script>

Astro requires the PUBLIC_ prefix for client-side environment variables.

Verify it's working

  1. Build and deploy your site
  2. Visit your live site
  3. Check the RevDock dashboard — widgets should appear within minutes

On this page