@cside.dev/next

中文文档
1.3.0发布于 2026/10/13MITTypeScriptESM + CJS零依赖近 30 天下载 4.9万

Next.js component

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. NextJS
  4. Props
  5. Minimum release age

@cside.dev/next

Integrate cside into your NextJS project with ease.

Installation

# npm
npm i @cside.dev/next

# yarn
yarn add @cside.dev/next

# pnpm
pnpm i @cside.dev/next

Usage

NextJS

Pages Router

// pages/_document.tsx
import Document, { Html, Head, Main, NextScript } from "next/document";
import { CSideScript } from "@cside.dev/next";

export default function Document() {
  return (
    <Html lang="en">
      <Head>
        <CSideScript /> {/* <- Here */}
      </Head>
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  );
}

App Router

// layout.tsx
import { CSideScript } from "@cside.dev/next";

export default function Layout({ children }) {
  return (
    <>
      <CSideScript /> {/* <- Here */}
      {children}
    </>
  );
}

Props

PropTypeDefaultDescription
teamIdstring—Your cside team ID. Loads the script from https://{teamId}.csidetm.com/script.js.
deviceIntelligencebooleanfalseLoad the device intelligence script instead of the default monitoring (tag manager) script. Swaps the host from csidetm.com/script.js to csidefd.com/client.js. The old fingerprint prop is still honored as an alias.
scriptURLOverridestring—Use a fully-custom script URL instead of building one from teamId. Useful for self-hosted proxies and testing.

Pass a teamId to load your team-scoped script:

<CSideScript teamId="your-team-id" />

To load the device intelligence script for that team:

<CSideScript teamId="your-team-id" deviceIntelligence />

If neither teamId nor scriptURLOverride is provided, the component falls back to the default proxy script at https://proxy.csidetm.com/script.js (or https://proxy.csidefd.com/client.js when deviceIntelligence is true).

Minimum release age

We recommend configuring a minimum release age so your package manager only installs versions that have been published for at least 7 days. Compromised package versions are typically detected and unpublished within days of publication, so a cooldown protects you from npm supply chain attacks. This applies to all your dependencies, not just this package.

# npm (.npmrc, in days)
min-release-age=7
# yarn (.yarnrc.yml, as a duration string)
npmMinimalAgeGate: "7d"
# pnpm (pnpm-workspace.yaml, in minutes)
minimumReleaseAge: 10080

版本与发布记录

@cside.dev/next 共发布 14 个版本,首次发布于 2025/01/31;过去 12 个月发布了 5 个版本。

版本发布日期距今
1.3.0latest2026/10/1329 天前
1.2.22026/07/153 个月前
1.2.12026/07/133 个月前
1.2.02026/05/205 个月前
1.1.42025/12/1210 个月前
1.1.22025/03/121.7 年前

关于 @cside.dev/next 的常见问题

@cside.dev/next 是什么?

Next.js component

如何安装 @cside.dev/next?

在项目目录运行 npm install @cside.dev/next,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:next(>=11.0.0)、react(>=16.2.6)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cside.dev/next 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cside.dev/next 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@cside.dev/next 可以商用吗?

@cside.dev/next 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cside.dev/next 的下载量有多少?

根据 npm 官方下载统计,@cside.dev/next 在 2026/10/11 – 2026/11/09 这 30 天内被下载 48,967 次,日均约 1,632 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cside.dev/next 还在维护吗?

最新版本 1.3.0 发布于 2026/10/13(29 天前);至今共发布 14 个版本,其中过去 12 个月发布了 5 个;首次发布于 2025/01/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。