---
description: >-
  This is a guide to learn how to initialize SmartCommands using the ApiBuilder
  class.
---

# ApiBuilder

### Initialize the API

To use `SmartCommands`, you must first initialize the API using the `ApiBuilder` class. First, create a new instance of the internal class `ApiBuilder`.

```java
new SmartCommandsAPI.ApiBuilder()
```

### ApiBuilder properties

| Property           | Default value     |
| ------------------ | ----------------- |
| `debug`            | `false`           |
| `commandsFilePath` | `"commands.json"` |

You can change the value of these properties using the following methods.

| Method                               | Description                                                        |
| ------------------------------------ | ------------------------------------------------------------------ |
| `debug(boolean debug)`               | Set `true` to enable the debugger or else set `false`              |
| `setCommandsFolderPath(String path)` | Set the path of the folder which contains the `commands.json` file |
| `build(Plugin plugin)`               | Initialize the API with the previously configured options          |

{% hint style="info" %}
Only the `build(Plugin plugin)` method is needed to initialize the API. The others are optional.
{% endhint %}

### Example

```java
SmartCommandsAPI api = new SmartCommandsAPI.ApiBuilder().build(this);
```

{% content-ref url="../get-started" %}
[get-started](../get-started)
{% endcontent-ref %}
