Skip to content

Configuration

Authentication

The Aha! API requires two pieces of information:

Parameter Description Example
Domain Your Aha! subdomain mycompany (from mycompany.aha.io)
API Key Your personal API key abc123...

CLI Configuration

Set environment variables in your shell profile:

export AHA_DOMAIN="mycompany"
export AHA_API_KEY="your-api-key-here"

Then use the CLI without flags:

aha ideas list

Command-Line Flags

Pass credentials directly (useful for scripts or one-off commands):

aha --domain mycompany --api-key your-api-key ideas list

Or use short flags:

aha -d mycompany -k your-api-key ideas list

Priority Order

The CLI uses credentials in this order:

  1. Command-line flags (--domain, --api-key)
  2. Environment variables (AHA_DOMAIN, AHA_API_KEY)

SDK Configuration

Using Environment Variables

import (
    "os"

    "github.com/grokify/go-aha/v3/oag7/aha"
    "github.com/grokify/go-aha/v3/oag7/client"
)

func main() {
    domain := os.Getenv("AHA_DOMAIN")
    apiKey := os.Getenv("AHA_API_KEY")

    cfg, err := client.NewConfiguration(domain, apiKey)
    if err != nil {
        panic(err)
    }

    apiClient := aha.NewAPIClient(cfg)
    // Use apiClient...
}

Direct Configuration

cfg, err := client.NewConfiguration("mycompany", "your-api-key")
if err != nil {
    panic(err)
}

apiClient := aha.NewAPIClient(cfg)

Security Best Practices

Environment Variables

Always use environment variables in production. Never hardcode API keys.

Git Ignore

Add .env and similar files to .gitignore to prevent accidental commits.

Example .env file (do not commit):

AHA_DOMAIN=mycompany
AHA_API_KEY=your-api-key-here

Load with a tool like direnv or source manually:

source .env