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

# Node.js SDK

> Logging, cloud level control, and MCP helper usage in Node.js

## Configure

```javascript theme={null}
const alshival = require('@alshival.ai/alshival');

alshival.configure({
  username: 'your_username',
  apiKey: 'your_api_key',
  resource: 'https://alshival.dev/u/resource_owner_username/resources/resource_uuid/', // paste Resource URL from DevTools Resource Details
  cloudLevel: 'ALERT',
  debug: false,
});
```

Set `resource` to the exact **Resource URL** shown on the DevTools Resource Details page. That URL works for both owned resources and resources shared with you.

## Disable cloud forwarding

```javascript theme={null}
alshival.configure({ cloudLevel: 'NONE' });
```

Accepted `cloudLevel` values: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `ALERT`, `NONE`.

## Logging

```javascript theme={null}
const alshival = require('@alshival.ai/alshival');

alshival.log.info('local logging flow');
alshival.log.warning('forwarded when cloudLevel <= WARNING');
alshival.log.error('forwarded when cloudLevel <= ERROR');
alshival.log.alert('high-priority incident');
```

## MCP tool descriptors

```javascript theme={null}
const OpenAI = require('openai');
const alshival = require('@alshival.ai/alshival');

const client = new OpenAI();

const tools = [
  alshival.mcp,
  alshival.mcp.github,
];

const response = await client.responses.create({
  model: 'gpt-5.2',
  input: 'Review deployment risks in my repos.',
  tools,
});
```

## Compatibility aliases

The Node SDK also exports Python-style aliases for compatibility:

* `mcp_tool` (alias of `mcpTool`)
* `github_mcp_tool` (alias of `githubMcpTool`)
