userpilot
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

How to use

Initialize

In your module.ts file import userpilot and initialize with your app token

import { Userpilot } from 'userpilot'
Userpilot.initialize('< your app token >');

Identify User

// .....

import { Userpilot } from 'userpilot'

// .....

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {

  // .....

  login() {
    this.loginService.login(this.form.value).then((user) => {

      Userpilot.identify(user.id, {name: user.firstName, email: user.email,created_at: user.signedUp});

      // ....

    }).catch((err) => {

    });
  }

}

For more information about Userpilot API please visit https://docs.userpilot.com/article/61-javascript-api

Package Sidebar

Install

npm i userpilot

Weekly Downloads

42,034

Version

1.3.1

License

USERPILOT LIMITED CODE REVIEW LICENCE

Unpacked Size

15.6 kB

Total Files

6

Last publish

Collaborators

  • karmiatuserpilot
  • samerfawadleh-u
  • majd_sehwail
  • subscriptions
  • thabet-userpilot