/tailscale-client-go

A client implementation for the Tailscale HTTP API

Primary LanguageGoMIT LicenseMIT

tailscale-client-go

Go Reference Go Report Card Github Actions

A client implementation for the Tailscale HTTP API. For more details, please see API documentation.

Example

package main

import (
	"context"
	"log"
	"os"

	"github.com/tailscale/tailscale-client-go/tailscale"
)

func main() {
	apiKey := os.Getenv("TAILSCALE_API_KEY")
	tailnet := os.Getenv("TAILSCALE_TAILNET")

	client, err := tailscale.NewClient(apiKey, tailnet)
	if err != nil {
		log.Fatalln(err)
	}

	// List all your devices
	devices, err := client.Devices(context.Background())
}