# JavaScript API

### Examples

#### Identify the current user

```
uzera("identify", {
 id: "YOUR_USER_ID",
 userData: {
   name: "John Doe",
   email: "john@example.com",
 },
});
```

#### Track event

```
uzera("track", { event: "CustomEventName" });
```

#### Track event with custom data

```
uzera("track", {
  event: "CustomEventName",
  data: {
    name: "123456789",
    price: 299.99,
  },
});
```

#### Launch Product Tour

```
uzeraMethods.launchProductTour("YOUR-TOUR-ID");
```

This function allows you to start a product tour anytime without verifying any trigger or segment conditions. You only need to pass the unique tour ID as a single argument to the function.

#### Hide Product Tour

```
uzeraMethods.hideProductTour("YOUR-TOUR-ID");
```

You can use this function to dismiss a product tour or trigger the completed event. If the product tour is already completed, the function will fire the completed event. Otherwise, it will dismiss the product tour. You need to pass the unique Tour ID of that product tour as a single argument to this function.

#### Launch Survey

```
uzeraMethods.launchSurvey("YOUR-SURVEY-ID");
```

This function can be used to launch a survey at any time, without checking the trigger or segment conditions. You only need to provide the survey ID, which you can copy from the survey list.

#### Hide Survey

<pre><code><strong>uzeraMethods.hideSurvey("YOUR-SURVEY-ID");
</strong></code></pre>

You can use this function to trigger a dismiss or completed event for a survey. When the function is called, if the survey is already completed and displaying a thank you screen, it will fire the completed event. In any other case, it will dismiss the survey. You only need to pass the unique survey ID as a single argument to the function.

#### Launch Onboarding Checklist

```
uzeraMethods.launchChecklist("YOUR-CHECKLIST-ID");
```

This function can be used to start a checklist at any time, regardless of any triggers or segment conditions. You just need to provide the unique checklist ID as a single parameter.

#### Hide Onboarding Checklist

```
uzeraMethods.hideChecklist("YOUR-CHECKLIST-ID");
```

This function triggers a dismiss event or a completed event for a checklist. If the checklist is already completed or displaying a congratulatory screen, calling this function will fire the completed event. Otherwise, it will dismiss the checklist. It required a single argument, which is the unique ID of the checklist.
