> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nullbridge.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Register your first AI agent with NullBridge in under 5 minutes

## Prerequisites

Before you begin, make sure you have:

* A NullBridge account (created by your admin in the dashboard)
* A valid license key (`NB-XXXX-XXXX-XXXX-XXXX`)
* Node.js 18 or higher

***

## Step 1 — Install the SDK

```bash theme={null}
npm install @nullbridge/sdk
```

***

## Step 2 — Initialize NullBridge

Create a file (e.g. `nullbridge.js`) in your project:

```js theme={null}
import pkg from '@nullbridge/sdk';
const { NullBridge } = pkg;

const nb = new NullBridge({
  licenseKey: 'NB-XXXX-XXXX-XXXX-XXXX', // your license key
});

await nb.init();
```

<Note>
  Replace `NB-XXXX-XXXX-XXXX-XXXX` with your actual license key. Contact [brian@nullbridge.ai](mailto:brian@nullbridge.ai) if you don't have one.
</Note>

***

## Step 3 — Register an Agent

```js theme={null}
const agent = await nb.agents.register({
  id: 'my-agent-001',        // unique ID for this agent
  name: 'MyFirstAgent',      // display name in the dashboard
  type: 'automation',        // agent type
  scopes: ['read:tasks'],    // minimum required scopes
  metadata: {
    owner_email: 'you@company.com',
    team: 'Engineering',
    environment: 'prod',     // dev | staging | prod
  },
});

console.log('Agent registered:', agent.id);
```

Once registered, your agent will appear in the **Agent Registry** on your NullBridge dashboard and a SIEM event will be logged.

***

## Step 4 — Shut down gracefully

```js theme={null}
await nb.shutdown();
```

Call `shutdown()` when your application exits to flush any pending logs and stop heartbeat timers.

***

## Full example

```js theme={null}
import pkg from '@nullbridge/sdk';
const { NullBridge } = pkg;

const nb = new NullBridge({
  licenseKey: process.env.NULLBRIDGE_LICENSE_KEY,
});

await nb.init();

const agent = await nb.agents.register({
  id: 'invoice-processor-001',
  name: 'InvoiceProcessor',
  type: 'automation',
  scopes: ['read:tasks', 'write:reports'],
  metadata: {
    owner_email: 'ops@company.com',
    team: 'Finance',
    environment: 'prod',
  },
});

console.log('Agent live:', agent.id);

// Your agent logic here...

await nb.shutdown();
```

***

## What happens next

After registration:

| System             | Action                                      |
| ------------------ | ------------------------------------------- |
| **Agent Registry** | Agent appears with tier, status, and scopes |
| **SIEM Events**    | `AGENT_REGISTERED` event logged             |
| **Vault**          | Credential lease opened                     |
| **IDP**            | OAuth2 client registered                    |

Your admin can now monitor, kill, restore, or rotate credentials for this agent from the dashboard.

***

## Environment variable (recommended)

Store your license key as an environment variable instead of hardcoding it:

```bash theme={null}
NULLBRIDGE_LICENSE_KEY=NB-XXXX-XXXX-XXXX-XXXX
```

```js theme={null}
const nb = new NullBridge({
  licenseKey: process.env.NULLBRIDGE_LICENSE_KEY,
});
```

***

## Next steps

<CardGroup cols={2}>
  <Card title="SDK Reference" icon="code" href="/sdk-reference">
    Full API reference for all SDK methods
  </Card>

  <Card title="Dashboard" icon="gauge" href="https://app.nullbridge.ai">
    View your agents, SIEM events, and policies
  </Card>
</CardGroup>
