> For the complete documentation index, see [llms.txt](https://docs.userlane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.userlane.com/developer-reference/quick-reference-of-commands.md).

# Quick reference of commands

All JavaScript commands in one place: load, identify, initialize, open the Assistant, hide, remove, language, start, and callbacks.

Commands issue instructions to Userlane from application code. Each heading below links to the article that covers that command in more depth.

## Load the script

Covered in [How Userlane is deployed](/deployment/rollout/how-userlane-is-deployed.md).

```javascript
// load Userlane
(function(i,s,o,g,r,a,m){i['UserlaneCommandObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)};a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://cdn.userlane.com/userlane.js','Userlane');
```

## Identify the user

Covered in [Attributes](/administration/attributes.md).

```javascript
// identify command
Userlane('identify', currentUser.id);
```

## Identify the user and pass custom attributes

Covered in [Attributes](/administration/attributes.md).

```javascript
// identify command with custom user attributes
Userlane('identify', currentUser.id, {
  attribute_key: 'attribute_value'
});
```

## Initialize Userlane

Covered in [How Userlane is deployed](/deployment/rollout/how-userlane-is-deployed.md).

```javascript
// initialize command
Userlane('init', property_ID);
```

## Open the Assistant

Covered in [Implement a command to open the Assistant](/developer-reference/implement-a-command-to-open-the-assistant.md).

```javascript
// open the Assistant
Userlane('openAssistant');
```

## Hide Userlane

Covered in [Hide Userlane on specific pages](/developer-reference/hide-userlane-on-specific-pages.md).

```javascript
// hide Userlane
Userlane('hide');

// show Userlane again by initializing it
Userlane('init', property_ID);
```

## Remove Userlane

```javascript
// remove Userlane
Userlane('removeUserlane');
```

## Set the language

Covered in [Userlane language detection](/developer-reference/userlane-language-detection.md).

```javascript
// set the language of Userlane
Userlane('lang', 'language_code');
```

## Start a Guide

Covered in [Start a Guide with a JavaScript command](/developer-reference/start-a-guide-with-a-javascript-command.md).

```javascript
// start a Guide
// replace 12345 with the Guide ID
Userlane('start', '12345');
```

```javascript
// start a Guide at a specific step
// replace 12345 with the Guide ID
// replace 4 with the index of the step
Userlane('start', '12345', 4);
```

```javascript
// start a Guide only once per user
// replace 12345 with the Guide ID
Userlane('startOnce', '12345');
```

## Callback events

Covered in [Hooking into event callbacks](/developer-reference/hooking-into-event-callbacks.md).

```javascript
// hook into onStart, onComplete or onExit and provide a callback function
// optionally replace onStart with onComplete or onExit
Userlane('onStart', function(userlaneId, user) {

// any code can go here

console.log('the user started a Guide');
});
```

```javascript
// remove all callbacks from the onStart event
Userlane('onStart', false);
```

```javascript
// example user object returned to the callback
{
id: '9717166719265375',
generated: true,
time_signup: '2017-11-22T11:50:48.671Z'
}
```

## Relevant articles

{% content-ref url="/pages/fsyxQCU0NHHxdU55aS9u" %}
[How Userlane is deployed](/deployment/rollout/how-userlane-is-deployed.md)
{% endcontent-ref %}

{% content-ref url="/pages/9LSBBfW7D6q4LDf7Zi6F" %}
[Implement a command to open the Assistant](/developer-reference/implement-a-command-to-open-the-assistant.md)
{% endcontent-ref %}

{% content-ref url="/pages/MIL8YAGDDCv85i0MnyuQ" %}
[Hide Userlane on specific pages](/developer-reference/hide-userlane-on-specific-pages.md)
{% endcontent-ref %}

{% content-ref url="/pages/heJOtTedSFOThPQGYSX3" %}
[Start a Guide with a JavaScript command](/developer-reference/start-a-guide-with-a-javascript-command.md)
{% endcontent-ref %}

{% content-ref url="/pages/QoC1TgEC9ALRtbtaX7F9" %}
[Hooking into event callbacks](/developer-reference/hooking-into-event-callbacks.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.userlane.com/developer-reference/quick-reference-of-commands.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
