LogstackLogstack

Installation

Install Logstack SDKs for JavaScript, Go, and Python.

Installation

Pick the SDK for your stack. All three use the same project API key and ingest endpoint (POST /v1/logs).

Requirements

SDKRuntime
JavaScript (logstack-js)Node.js 16+, modern browsers, Deno, Bun
Go (logstack-go-sdk)Go 1.21+
Python (logstack-py)Python 3.7+

Package install

npm install logstack-js
# yarn add logstack-js
# pnpm add logstack-js
# bun add logstack-js

Verify installation

import { createLogStack } from "logstack-js";
 
const logstack = createLogStack({
  apiKey: process.env.LOGSTACK_API_KEY!,
  endpoint: "https://api.logstack.tech",
});
 
logstack.info("Installation test");
await logstack.flush();
console.log("logstack-js ready");

Self-hosted endpoint

Point any SDK at your own API host (no /v1 suffix required):

const logstack = createLogStack({
  apiKey: process.env.LOGSTACK_API_KEY!,
  endpoint: "https://logs.your-domain.com", // or http://localhost:8080
});

Self-hosted instances use the same SDKs — only the host URL changes.

CDN (browser, JS only)

<script type="module">
  import { createLogStack } from "https://esm.sh/logstack-js";
 
  const logstack = createLogStack({ apiKey: "ls_live_xxx" });
  logstack.info("Page loaded", { url: window.location.href });
</script>

Never expose production API keys in public client-side code. Prefer a backend proxy for browser logging.

Next steps

On this page