Skip to main content
A Next.js React Server Component for fetching and rendering external JavaScript files on the server-side before page rendering. This package provides secure, cached script loading with TypeScript support.

Installation

Every rendered <script> tag must include a data-code attribute set to your Account ID (verification code). AdUnblock uses this value to verify that the script is running on your registered domain. Find your Account ID at the top of your AdUnblock dashboard.

Basic Usage

Import and use the ServerTag component in your Next.js pages or layouts:

Advanced Usage

Custom Caching

Custom Script Rendering

Override the default script rendering with a custom callback:

API Reference

Props

Types

Security

  • Only HTTP and HTTPS URLs are allowed
  • Server-side execution prevents client-side script injection
  • URL validation prevents malicious protocol usage

Browser Compatibility

This package works with all browsers supported by Next.js 15+ and React 19.