Skip to main content

Installation

Install the package with go get:
go get github.com/loops-so/loops-go
Want your coding agent to help with Loops? Install the Loops CLI and skills with one command:
curl -fsSL https://install.loops.so/wizard | sh
You will need a Loops API key to use the SDK. In your Loops account, go to the API Settings page and click Generate key. Copy this key and save it in your application code (for example as LOOPS_API_KEY in an environment variable).

Usage

package main

import (
	"log"

	loops "github.com/loops-so/loops-go"
)

func main() {
	client := loops.NewClient("YOUR_API_KEY")

	err := client.SendEvent(loops.SendEventRequest{
		Email:     "user@example.com",
		EventName: "signup",
		EventProperties: map[string]any{
			"plan": "pro",
		},
	})
	if err != nil {
		log.Fatal(err)
	}
}
API errors are returned as *loops.APIError with StatusCode and Message. See the SDK README on GitHub for error handling, retries, pagination, uploads, and the full method list. See the API documentation to learn more about rate limiting and error handling.

pkg.go.dev reference

Browse types, methods, and package documentation.

GitHub

View the source code and release notes.

Loops API

Read the Loops API reference.
Last modified on May 27, 2026