Skip to main content

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.
LanguageInstallationDocumentationRepository
Gogo get github.com/ngrok/ngrok-api-go/v4DocumentationGitHub
.NETdotnet add package NgrokApiDocumentationGitHub
Rubygem install ngrok-apiDocumentationGitHub
Pythonpip install ngrok-apiDocumentationGitHub
Java (unstable)See the README for installing with MavenDocumentationGitHub
Scala (unstable)See the README for installing with MavenDocumentationGitHub
For more details, see the API 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. 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.

example.tf

# 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 documentation.