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

# Manage ngrok Programmatically With Terraform and API Client Libraries

> Use ngrok's API client libraries and Terraform provider to manage your ngrok resources as code.

## API client libraries

Open-source API client libraries are published to make working with the ngrok API
feel native and fluent in your favorite programming language. Library
repositories are published in the [ngrok github
organization](https://github.com/ngrok).

| Language         | Installation                              | Documentation                                                        | Repository                                          |
| ---------------- | ----------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------- |
| Go               | `go get github.com/ngrok/ngrok-api-go/v4` | [Documentation](https://pkg.go.dev/github.com/ngrok/ngrok-api-go/v4) | [GitHub](https://github.com/ngrok/ngrok-api-go)     |
| .NET             | `dotnet add package NgrokApi`             | [Documentation](https://github.com/ngrok/ngrok-api-dotnet)           | [GitHub](https://github.com/ngrok/ngrok-api-dotnet) |
| Ruby             | `gem install ngrok-api`                   | [Documentation](https://ruby-api.docs.ngrok.com)                     | [GitHub](https://github.com/ngrok/ngrok-api-ruby)   |
| Python           | `pip install ngrok-api`                   | [Documentation](https://python-api.docs.ngrok.com)                   | [GitHub](https://github.com/ngrok/ngrok-api-python) |
| Java (unstable)  | See the README for installing with Maven  | [Documentation](https://java-api.docs.ngrok.com)                     | [GitHub](https://github.com/ngrok/ngrok-api-java)   |
| Scala (unstable) | See the README for installing with Maven  | [Documentation](https://python-api.docs.ngrok.com)                   | [GitHub](https://github.com/ngrok/ngrok-api-scala)  |

For more details, see the [API Client Libraries](/api-reference#client-libraries) documentation.

## Terraform provider

When you use ngrok resources as part of production infrastructure, it is an
industry best practice to define them using an infrastructure-as-code tool like
[Terraform](https://www.terraform.io/). An official Terraform
provider is published that consumes the ngrok API to manage your resources in this way.

Consult the documentation for the [ngrok Terraform provider on Hashicorp's
Terraform
Registry.](https://registry.terraform.io/providers/ngrok/ngrok/latest/docs)

#### example.tf

```hcl theme={null}
# Configure the ngrok provider
provider "ngrok" {
  api_key = "{API_KEY}"
}

# Provision an ngrok domain
resource "ngrok_reserved_domain" "my_domain" {
  name   = "my-domain.example.com"
  region = "us"
  certificate_management_policy {
    authority        = "letsencrypt"
    private_key_type = "ecdsa"
  }
}
```

For more details, see the [Terraform Provider](/api-reference#terraform-provider) documentation.
