Installation
Add Logged to your application in minutes. The SDK is lightweight, works in the browser and Node.js, and sends logs to the Logged API.
Install the SDK
npm install @oheoco/loggedThis installs the @oheoco/logged package into your project.
Initialize the client
import { Logged } from "@oheoco/logged";
const logger = new Logged({
apiKey: process.env.LOGGED_API_KEY!,
});API key
Send a log
logger.info("Application started");That's enough to send your first log. Open the dashboard to see it appear in real time.
Configuration options
The Logged constructor accepts the following options in the current SDK:
| Property | Required | Description |
|---|---|---|
| apiKey | Yes | Project API key from the dashboard. |
| environment | No | Application environment, such as development, staging, or production. |
| debug | No | Enable extra SDK logging for failed network requests and internal capture errors. |
The SDK always posts to the Logged ingestion endpoint and does not currently expose a custom baseUrl option in the constructor.
Where to store your API key
Security
For server-side applications, use a standard environment variable such as LOGGED_API_KEY. For browser applications, prefix the variable with NEXT_PUBLIC_ or VITE_ so it is available at runtime.
Next steps
Once Logged is installed, follow the Quick Start to create a project and send your first log.