Configuration
- Curl
- Python
- Ruby
- Javascript
- Go
Copy
Ask AI
LAGO_URL="https://api.getlago.com" API_KEY="__YOUR_API_KEY__" curl --location --request POST "$LAGO_URL/api/v1/..." \ --header "Authorization: Bearer $API_KEY" \ --header 'Content-Type: application/json' \ --data-raw '...' Install package with pipUsage
Copy
Ask AI
pip install lago-python-client Copy
Ask AI
from lago_python_client import Client # By default, this connects to Lago's hosted servers in the US region. client = Client(api_key='__YOUR_API_KEY__') # If you are self-hosting Lago or using a different server region, # specify the API URL to connect to the correct instance. # Replace '__YOUR_LAGO_URL__' with the appropriate URL for your Lago server. # Example: 'https://api.eu.getlago.com/' for the EU region. # client = Client(api_key='__YOUR_API_KEY__', api_url='__YOUR_LAGO_URL__') Add the gem in your GemfileOr if bundler is not being used to manage dependencies, install the gem by executing:Usage
Copy
Ask AI
bundle add lago-ruby-client Copy
Ask AI
gem install lago-ruby-client Copy
Ask AI
require 'lago-ruby-client' # By default, this will connect to the US region of Lago's hosted servers. client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__') # If you are self-hosting Lago or using Lago in a different region (e.g., Europe), # you need to specify the API URL to connect to the correct server. # For example, you can provide the base URL for your specific Lago instance. # This example shows how to specify a different Lago server when needed. # # Replace '__YOUR_LAGO_URL__' with the appropriate URL of your Lago instance. # Example: 'https://api.eu.getlago.com/' for the EU region. # # client = Lago::Api::Client.new( # api_key: '__YOUR_API_KEY__', # api_url: '__YOUR_LAGO_URL__' # ) Install package with npmUsage
Copy
Ask AI
npm install lago-javascript-client Copy
Ask AI
import { Client } from 'lago-javascript-client' // By default, this will connect to Lago's hosted servers in the US region. const client = Client('__YOUR_API_KEY__') // If you are self-hosting Lago or using a different region (e.g., EU), // you need to specify the base URL to connect to the correct Lago instance. // Replace '__YOUR_LAGO_URL__' with the appropriate URL for your Lago instance. // Example: 'https://api.eu.getlago.com/' for the EU region. // const client = Client('__YOUR_API_KEY__', { baseUrl: '__YOUR_LAGO_URL__' }) Install packageUsage
Copy
Ask AI
go get github.com/getlago/lago-go-client@v1 Copy
Ask AI
import "github.com/getlago/lago-go-client" func main() { // By default, this will connect to Lago's hosted servers in the US region. lagoClient := lago.New().SetApiKey("__YOU_API_KEY__") // If you are self-hosting Lago or using a different region (e.g., EU), // you need to specify the base URL to connect to the correct Lago instance. // Replace '__YOUR_LAGO_URL__' with the appropriate URL for your Lago instance. // Example: 'https://api.eu.getlago.com/' for the EU region. // lagoClient := lago.New().SetApiKey("__YOUR_API_KEY__").SetBaseURL("__YOUR_LAGO_URL__") }