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

# Installation

> Add the Resend Go SDK to your project

Get the Resend Go SDK installed and configured in your Go application.

## Requirements

Before installing the SDK, ensure your environment meets these requirements:

* **Go 1.23 or later** - The SDK requires Go 1.23+
* **Go modules** - The SDK uses Go modules for dependency management

## Install the SDK

<Steps>
  <Step title="Install via go get">
    Add the Resend Go SDK to your project using the `go get` command:

    ```bash theme={null}
    go get github.com/resend/resend-go/v3
    ```

    This downloads the SDK and adds it to your `go.mod` file.
  </Step>

  <Step title="Import the package">
    Import the Resend package in your Go files:

    ```go theme={null}
    import "github.com/resend/resend-go/v3"
    ```

    <Note>
      Make sure to use the `/v3` suffix in the import path to get the latest version of the SDK.
    </Note>
  </Step>

  <Step title="Verify installation">
    Create a simple file to verify the installation:

    ```go theme={null}
    package main

    import (
        "fmt"
        "github.com/resend/resend-go/v3"
    )

    func main() {
        client := resend.NewClient("your_api_key")
        fmt.Println("Resend client initialized successfully")
    }
    ```

    Run the file to confirm everything is working:

    ```bash theme={null}
    go run main.go
    ```

    You should see the success message printed to the console.
  </Step>
</Steps>

## Package structure

The Resend Go SDK is organized into service-based modules:

```go theme={null}
package main

import "github.com/resend/resend-go/v3"

func main() {
    client := resend.NewClient("re_123")

    // Access different services through the client
    client.Emails       // Send and manage emails
    client.Batch        // Send batch emails
    client.Domains      // Manage domains
    client.ApiKeys      // Manage API keys
    client.Contacts     // Manage contacts
    client.Segments     // Manage segments (audiences)
    client.Broadcasts   // Send broadcasts
    client.Templates    // Manage email templates
    client.Topics       // Manage topics
    client.Webhooks     // Manage webhooks
}
```

## Dependencies

The SDK has minimal dependencies. The only testing dependency is:

* `github.com/stretchr/testify` - Used for testing (not required in production)

All other dependencies are part of the Go standard library.

## Custom HTTP client

By default, the SDK uses a standard HTTP client with a 1-minute timeout. You can provide your own HTTP client for custom configurations:

```go theme={null}
package main

import (
    "net/http"
    "time"
    "github.com/resend/resend-go/v3"
)

func main() {
    // Create custom HTTP client
    httpClient := &http.Client{
        Timeout: 30 * time.Second,
    }

    // Initialize Resend with custom client
    client := resend.NewCustomClient(httpClient, "re_123")
}
```

This is useful when you need to:

* Configure custom timeouts
* Add retry logic
* Use custom transport layers
* Implement request/response logging

## Environment configuration

<Note>
  The SDK reads the `RESEND_BASE_URL` environment variable if you need to use a custom API endpoint. This is typically only needed for testing or enterprise configurations.
</Note>

## Next steps

Now that you have the SDK installed, you're ready to send your first email:

<Card title="Quickstart" icon="rocket" href="/quickstart">
  Learn how to send your first email with the Resend Go SDK
</Card>
