Installation
Basic Usage
Import and use theServerTag
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
Prop | Type | Default | Description |
---|---|---|---|
remoteUrl | string | Required | The URL to fetch script URLs from |
cacheInterval | number | 300 | Cache duration in seconds |
renderScript | function | undefined | Custom script rendering function |
Types
Security
- Only HTTP and HTTPS URLs are allowed
- Server-side execution prevents client-side script injection
- URL validation prevents malicious protocol usage