wihan/dev

projects / detail

terraform-provider-clerk

github ↗markdown

Clerk is a hosted auth platform. This provider manages the configuration of a Clerk instance through the Clerk Backend API: JWT templates, redirect URLs, sign-up restrictions, API keys, machines, domains, webhooks, organizations, and SSO.

Both providers here share the same skeleton: the Terraform plugin framework, a thin API client, and acceptance tests that run against the real service in CI.

Usage

terraform {
  required_providers {
    clerk = {
      source  = "vanillauys/clerk"
      version = "~> 0.7"
    }
  }
}

provider "clerk" {
  # secret_key falls back to the CLERK_SECRET_KEY environment variable
  secret_key = var.clerk_secret_key
}

One provider block targets one Clerk instance. Use a provider alias for a second instance, for example dev and prod.

The full reference is at /docs/clerk: every resource, data source, and guide.

For agents

  • Install from the Terraform registry: source vanillauys/clerk. The provider is pre-1.0; pin an exact version if you need stability.
  • Authenticate with the instance secret key (sk_test_... or sk_live_...) in secret_key, or set the CLERK_SECRET_KEY environment variable.
  • Read the reference at https://wihan.dev/docs/clerk. Append .md to any docs URL for raw markdown, for example https://wihan.dev/docs/clerk/resources/webhook.md.
  • Read the guides first: getting started, dev and prod instances, adopting an existing instance, and secrets.
  • Known traps: the instance-level singletons adopt on create and never delete the instance; some fields are write-only, so the provider cannot see dashboard drift on them; the state file holds secrets.
  • Source and issues: github.com/vanillauys/terraform-provider-clerk.