> For the complete documentation index, see [llms.txt](https://assisfy.gitbook.io/assisfy.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://assisfy.gitbook.io/assisfy.ai/getting-started/using-the-assisfy-sdk/sdk-quickstart.md).

# SDK Quickstart

## **Setting Up Your Environment**

Before you begin, make sure you have the following:

* A valid API key from Assisfy.
* Node.js and npm installed on your machine.

### **Running Your First Agent**

Here’s a step-by-step guide to run your first agent using Assisfy.

1. **Create an Assisfy Client:**

```javascript
const assisfy = new Assisfy({
  apiKey: 'your-api-key', // Replace with your Assisfy API key
});
```

2. **Initialize the Agent:**

You’ll initialize a session by calling the `initialize` method.

```javascript
const session = await assisfy.session().create({
    goal: "Who is the president of the United States?",
});
```

3. **Events**

You can now begin handling events such as when a session starts, or an action is performed. Use `session.on` to handle events for the current session.

```javascript

session.on('session_created', (data) => {
    console.log('session_created', data);
});

session.on('session_connected', (data) => {
    console.log('session_connected', data);
});

session.on('session_error', (data) => {
    console.log('session_error', data);
});

session.on('session_disconnected', (data) => {
    console.log('session_disconnected', data);
});
```
