0.2.1 • Published 9 months ago

@usertimeline/react v0.2.1

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

@usertimeline/react

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/react
# or
yarn add @usertimeline/react
# or
pnpm add @usertimeline/react

Usage

Add the script to your saas/website.

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

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/react';

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/react';

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>
  );
}

Use component after the initial script

import { UsertimelineAuth } from '@usertimeline/react';

export default function Layout() {
  return (
    <html lang="en">
      <body>
        <UsertimelineAuth
          externalid="{{YOUR_EXTERNAL_ID_HERE}}"
          name="{{YOUR_NAME_HERE}}"
          email="{{YOUR_EMAIL_HERE}}"
        />
      </body>
    </html>
  );
}
0.1.0

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago