Embedding
Embed StweetHQ in your app
Embedding
Integrate StweetHQ testimonial displays directly into your application with full control over rendering, styling, and behavior.
Overview
Beyond the standard widget embed codes, StweetHQ offers deeper embedding options for developers who want complete control. Use the JavaScript SDK to fetch testimonial data and render it with your own components, or use the headless API to build fully custom testimonial experiences.
Script Embed
The simplest embedding method is the drop-in script tag. Add the StweetHQ script to your page and use data attributes on a container element to configure which testimonials to display. The script handles fetching, rendering, and responsive layout automatically with minimal configuration.
Headless Mode
For full control over the UI, use the SDK in headless mode. This fetches testimonial data from the API and returns plain objects that you can render however you like. Headless mode is ideal for design-heavy sites where you need testimonials to match a custom layout or animation system exactly.
Server-Side Rendering
StweetHQ supports SSR for frameworks like Next.js, Nuxt, and SvelteKit. Fetch testimonials at build time or request time using the SDK and pass the data to your components. This approach eliminates layout shifts and ensures testimonials are included in the initial HTML for optimal SEO.
Next Steps
Check out the code examples for complete embedding implementations, or review the API reference for the full list of query parameters available when fetching testimonials.