getlago/lago-go-client

Lago Go Client

Go

31

485 commits

updated Sep 18, 2026

See the code

README

Lago Go Client

This is a Go wrapper for Lago API

License: MIT

Current Releases

ProjectRelease Badge
LagoLago Release
Lago Go ClientLago Go Client Release

Installation

To use the client in your Go application:

go get github.com/getlago/lago-go-client@v1

Usage

Once the package is installed, you can use it in your Go application as follows:

package main

import (
	"context"
	"fmt"
	"log"

	lago "github.com/getlago/lago-go-client"
)

func main() {
	client := lago.New().SetApiKey("xyz")

	ctx := context.TODO()
	// Example: List customers
	billableMetrics, err := client.BillableMetric().GetList(ctx, &lago.BillableMetricListInput{
		Page:    1,
		PerPage: 10,
	})
	if err != nil {
		log.Fatalf("Error fetching Billable Metrics: %v", err)
	}

	fmt.Println("List of Billable Metrics:")
	for _, billableMetric := range billableMetrics.BillableMetrics {
		fmt.Printf("- %s\n", billableMetric.Name)
	}
}

For detailed usage, refer to the lago API reference.

Development

Prerequisites

  • Go 1.18 or higher
  • Git

Setup

  1. Clone the repository:

    git clone https://github.com/getlago/lago-go-client.git
    cd lago-go-client
    
  2. Install dependencies:

    go mod download
    

Testing

Run the test suite:

go test ./...

Code Quality

Format code:

go fmt ./...

Run linting (requires golangci-lint):

# Install golangci-lint
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.2

# Run linter
golangci-lint run

Documentation

The Lago documentation is available at doc.getlago.com.

Contributing

The contribution documentation is available here

License

Lago Go client is distributed under MIT license.

Contributors

(top 30 of 49)

rsempe

77 commits

vincent-pochet

73 commits

jdenquin

39 commits

lovrocolic

39 commits

getlago/lago-go-client

Lago Go Client

Go

31

485 commits

updated Sep 18, 2026

See the code

README

Lago Go Client

This is a Go wrapper for Lago API

License: MIT

Current Releases

ProjectRelease Badge
LagoLago Release
Lago Go ClientLago Go Client Release

Installation

To use the client in your Go application:

go get github.com/getlago/lago-go-client@v1

Usage

Once the package is installed, you can use it in your Go application as follows:

package main

import (
	"context"
	"fmt"
	"log"

	lago "github.com/getlago/lago-go-client"
)

func main() {
	client := lago.New().SetApiKey("xyz")

	ctx := context.TODO()
	// Example: List customers
	billableMetrics, err := client.BillableMetric().GetList(ctx, &lago.BillableMetricListInput{
		Page:    1,
		PerPage: 10,
	})
	if err != nil {
		log.Fatalf("Error fetching Billable Metrics: %v", err)
	}

	fmt.Println("List of Billable Metrics:")
	for _, billableMetric := range billableMetrics.BillableMetrics {
		fmt.Printf("- %s\n", billableMetric.Name)
	}
}

For detailed usage, refer to the lago API reference.

Development

Prerequisites

  • Go 1.18 or higher
  • Git

Setup

  1. Clone the repository:

    git clone https://github.com/getlago/lago-go-client.git
    cd lago-go-client
    
  2. Install dependencies:

    go mod download
    

Testing

Run the test suite:

go test ./...

Code Quality

Format code:

go fmt ./...

Run linting (requires golangci-lint):

# Install golangci-lint
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.2

# Run linter
golangci-lint run

Documentation

The Lago documentation is available at doc.getlago.com.

Contributing

The contribution documentation is available here

License

Lago Go client is distributed under MIT license.

Contributors

(top 30 of 49)

rsempe

77 commits

vincent-pochet

73 commits

jdenquin

39 commits

lovrocolic

39 commits

Languages

Go

100.0%