0.1.0 • Published 4 months ago

@usertimeline/nextjs v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

@usertimeline/nextjs

After creating an account and adding the domain (or subdomain) you want to track, you need to add the script to your saas/website.

Create a Usertimeline account

Install

npm install @usertimeline/nextjs
# or
yarn add @usertimeline/nextjs
# or
pnpm add @usertimeline/nextjs

Usage

Add the script to your saas/website.

import { UsertimelineScript } from '@usertimeline/nextjs';

export default function Layout() {
  return (
    <html lang="en">
      <body>
        {/* replace the YOUR_PROJECT_CODE_HERE with the project code */}
        <UsertimelineScript project="YOUR_PROJECT_CODE_HERE" />
      </body>
    </html>
  );
}

That's it! Now you can track users on your saas/website.

Disable features

You can disable features like page view, click, or both.

import { UsertimelineScript } from '@usertimeline/nextjs';

export default function Layout() {
  return (
    <html lang="en">
      <body>
        {/* replace the YOUR_PROJECT_CODE_HERE with the project code */}
        <UsertimelineScript
          project="YOUR_PROJECT_CODE_HERE"
          disableFeature="page_view,click"
        />
      </body>
    </html>
  );
}

Authenticated users

You can track authenticated users on your saas/website in 3 ways:

Using the script

You can add one or more of the 3 additional parameters. Remember to replace the parameters with your data.

import { UsertimelineScript } from '@usertimeline/nextjs';

export default function Layout() {
  return (
    <html lang="en">
      <body>
        {/* replace the YOUR_PROJECT_CODE_HERE with the project code */}
        <UsertimelineScript
          project="YOUR_PROJECT_CODE_HERE"
          externalId="{{YOUR_EXTERNAL_ID_HERE}}"
          name="{{YOUR_NAME_HERE}}"
          email="{{YOUR_EMAIL_HERE}}"
        />
      </body>
    </html>
  );
}
0.1.0

4 months ago