Documentation

Logwise is designed to be the simplest error explanation tool for developers.
Use our official Node.js SDK for the best experience.

Node.js SDK

1Installation

npm install logwise-sdk

2Configuration

Set your API key in your environment variables (or .env file).

LOGWISE_API_KEY=sk_live_...

3Usage

Catch an error and explain it in one line.

Parameters

  • errorThe Error object or string you want explained.
  • optionsOptional config object: { includeFix: boolean }
import { explain } from 'logwise-sdk';

try {
  // Your risky code...
  throw new Error("Something went wrong!");
} catch (error) {
  // Pass the raw error object directly
  const { explanation, fix } = await explain(error, { includeFix: true });
  console.log(explanation);
  console.log(fix); // Array of steps to solve it
}

4React Error Boundary Widget

Drop in our pre-built React Error Boundary component to automatically catch screen-crashing bugs and present users with a helpful explanation instead of a whitescreen. It automatically tracks "Aha!" scores too!

import { LogwiseErrorBoundary } from 'logwise-sdk/react';

function App() {
  return (
    // Wrap your app or specific risky components
    <LogwiseErrorBoundary theme="dark">
      <MyRiskyDashboard />
    </LogwiseErrorBoundary>
  );
}

Raw API

1Authentication

Include your API key in the x-api-key header of every request. You can generate a key in your Dashboard.

x-api-key: sk_live_...

2Endpoint

Send a POST request to https://api.getlogwise.com/explain.

Request Body

  • codeThe error code (e.g. 500). Optional.
  • messageThe error message string.
  • contextStack trace. (PII is auto-redacted).
  • targetAudience"user" or "developer".
const res = await fetch('https://api.getlogwise.com/explain', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'sk_live_...'
  },
  body: JSON.stringify({
    code: '500', 
    message: 'Internal Server Error',
    targetAudience: 'developer',
    includeFix: true
  })
});

const data = await res.json();
console.log(data.explanation);
console.log(data.fix); // Array of suggestions

Integrations

Logwise can automatically forward explanations to your favorite tools. Integrations are tied to your user account and triggered on every /explain call (including API and SDK).

Slack

Receive rich, block-kit formatted messages in any Slack channel.

  1. Create an Incoming Webhook in your Slack workspace.
  2. Copy the Webhook URL.
  3. Go to the Logwise Dashboard and click Add Integration.
  4. Select Slack, enter a name, and paste the URL.

Generic Webhooks

Forward explanations to Zapier, Make, or your own backend API. Logwise sends a POST request with a JSON payload:

{
  "event": "error.explained",
  "timestamp": "2023-10-25T12:00:00Z",
  "data": {
    "errorCode": "500",
    "errorMessage": "database connection failed",
    "explanation": "The app couldn't connect to the database securely.",
    "fix": [
      "Check database credentials",
      "Verify network firewall rules"
    ]
  }
}

Zendesk

Automatically append Logwise explanations as internal notes on Zendesk tickets using the Zendesk API.

  1. Generate an API token in your Zendesk Admin Center (Apps and Integrations > Zendesk API).
  2. In the Logwise Dashboard, add a Zendesk integration.
  3. Provide your Zendesk subdomain (e.g., mycompany), the agent email, and the API token.

Freshdesk

Automatically create tickets and append Logwise explanations as private notes on Freshdesk.

  1. Generate an API key in your Freshdesk Profile Settings.
  2. In the Logwise Dashboard, add a Freshdesk integration.
  3. Provide your Freshdesk subdomain (e.g., mycompany) and the API token.

Gleap

Create comprehensive bug reports with embedded Logwise AI explanations as internal comments.

  1. Generate an API token in your Gleap Dashboard (Project Settings > Security > API Key).
  2. In the Logwise Dashboard, add a Gleap integration.
  3. Paste your Gleap API token.

Rate Limits

We enforce a rate limit of 100 requests per minute to prevent abuse. In addition, your account is subject to a monthly quota based on your plan (e.g., 100 requests/month for the Free plan).