Docs

Add Redline to your framework

For a bundler, install @perpetio/redline, call init() after mount, and call destroy() on unmount. Use spa: true when your router changes paths through the History API. Dynamic content is watched and re-anchored after it renders. The classic script remains available for static pages.

React and Next.js

Mount it once at the app root with a useEffect:

// components/FeedbackLayer.jsx
import { useEffect } from "react";
import Redline from "@perpetio/redline";

export default function FeedbackLayer() {
  useEffect(() => {
    Redline.init({ project: "my-react-app", accent: "#bd3426", spa: true });
    return () => Redline.destroy();
  }, []);
  return null;
}
// App.jsx
import FeedbackLayer from "./components/FeedbackLayer";

export default function App() {
  return (
    <>
      <FeedbackLayer />
      {/* your app */}
    </>
  );
}

Next.js (App Router): mark FeedbackLayer as a client component with "use client"; at the top, then render it inside app/layout.jsx.

Vue 3

<!-- App.vue -->
<script setup>
import { onMounted, onUnmounted } from "vue";
import Redline from "@perpetio/redline";

onMounted(() => {
  Redline.init({ project: "my-vue-app", accent: "#10b981", spa: true });
});
onUnmounted(() => Redline.destroy());
</script>

For a static Vue page, the classic <script> tag also works in index.html.

WordPress

Option A — no code. Install a "header/footer scripts" plugin (e.g. WPCode or Insert Headers and Footers) and paste this into the footer box:

<script src="https://cdn.jsdelivr.net/npm/@perpetio/redline/redline.js" data-project="my-wp-site" defer></script>

Option B — theme code. Add to your theme's functions.php:

function redline_enqueue() {
  wp_enqueue_script(
    'redline',
    'https://cdn.jsdelivr.net/npm/@perpetio/redline/redline.js',
    array(),
    '2.4.0',
    true // load in footer
  );
}
add_action( 'wp_enqueue_scripts', 'redline_enqueue' );

Tip: wrap the enqueue in if ( current_user_can('edit_posts') ) to show the review tools only to logged-in editors.

Svelte and SvelteKit

<!-- src/routes/+layout.svelte -->
<script>
  import { onMount } from "svelte";
  import Redline from "@perpetio/redline";
  onMount(() => {
    Redline.init({ spa: true });
    return () => Redline.destroy();
  });
</script>

<slot />

Angular

Add the classic script before </body> in src/index.html. Enable SPA mode so feedback stays grouped by route as the Angular router changes paths:

<script src="https://cdn.jsdelivr.net/npm/@perpetio/redline/redline.js"
        data-project="my-angular-app" data-spa="true" defer></script>

Plain HTML, Webflow, Shopify, and Squarespace

Paste before </body> (or into the platform's "custom code / footer" field):

<script src="https://cdn.jsdelivr.net/npm/@perpetio/redline/redline.js" defer></script>