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

# Node.js SDK usage

> Initialize the Telnyx Node.js client and make your first typed API request.

## Usage

The full API of this library can be found in [api.md](https://github.com/team-telnyx/telnyx-node/tree/master/api.md).

```js theme={null}
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const response = await client.calls.dial({
  connection_id: 'conn12345',
  from: '+15557654321',
  to: '+15551234567',
  webhook_url: 'https://your-webhook.url/events',
});

console.log(response.data);
```

### Request & Response types

This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:

```ts theme={null}
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const params: Telnyx.NumberOrderCreateParams = { phone_numbers: [{ phone_number: '+15558675309' }] };
const numberOrder: Telnyx.NumberOrderCreateResponse = await client.numberOrders.create(params);
```

Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
