Integration Guide

JavaScript Embed

Add beautiful testimonial widgets to any website with just a few lines of code. Works with all modern frameworks, CMSs, and static sites.

Quick Start

1

Get your Widget ID

Navigate to your dashboard, create or select a widget, and copy the Widget ID from the embed settings.

Go to Widgets
2

Add the container

Place a div element where you want the testimonials to appear.

HTML
<!-- Add this where you want testimonials -->
<div id="prooflayer-widget"></div>
3

Add the script

Include the ProofLayer script and initialize it with your Widget ID. Place this before the closing </body> tag.

JavaScript
<script src="https://cdn.prooflayer.app/widget.js"></script>
<script>
  ProofLayer.init({
    widgetId: 'your-widget-id',
    container: '#prooflayer-widget'
  });
</script>

Configuration Options

OptionTypeDefaultDescription
widgetIdstringrequiredYour unique widget identifier
containerstring'#prooflayer-widget'CSS selector for the container element
themestring'light''light', 'dark', or 'auto' (system preference)
layoutstring'grid''grid', 'carousel', 'masonry', or 'list'
maxItemsnumber12Maximum number of testimonials to display
showRatingsbooleantrueWhether to display star ratings
showAvatarsbooleantrueWhether to display user avatars

Full Example

Complete Integration
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Website</title>
</head>
<body>
  <!-- Your website content -->

  <section id="testimonials">
    <h2>What Our Customers Say</h2>
    <div id="prooflayer-widget"></div>
  </section>

  <!-- ProofLayer Widget -->
  <script src="https://cdn.prooflayer.app/widget.js"></script>
  <script>
    ProofLayer.init({
      widgetId: 'wgt_abc123xyz',
      container: '#prooflayer-widget',
      theme: 'light',
      layout: 'masonry',
      maxItems: 9,
      showRatings: true,
      showAvatars: true
    });
  </script>
</body>
</html>

Framework-Specific Guides

React / Next.js

Use useEffect or dynamic import

Vue.js

Mount in onMounted lifecycle

WordPress

Add to theme footer or use plugin

Webflow

Use custom code embed block

Security Note

Your Widget ID is safe to use in client-side code. It only allows reading approved testimonials from your widget. No sensitive data can be accessed or modified using this ID.

Next Steps