Getting Started
Quick Start
Get Reliable running in your app in under two minutes. This walkthrough assumes you've already installed the SDK.
Just want to try it first?
1. Get your public key#
Open the Reliable dashboard, create a project (or pick an existing one), and copy the public key from Settings → API Keys. Public keys start with pk_live_rl_ for production projects and pk_test_rl_ for test projects.
Public, not secret
2. Initialize the SDK#
Call init() as early as possible in your app's bootstrap. Doing this first means errors that fire during initial render are still captured.
// app entry — main.ts, index.ts, src/index.tsx, etc.
import { init } from '@reliableapp/frontend-core';
init({
publicKey: 'pk_live_rl_xxxxxxxxxxxxxxxx',
});That's it. The SDK is now capturing JavaScript errors, unhandled promise rejections, Core Web Vitals, failed network requests, click events, and route changes — all attributed to the current session.
React apps#
For React, wrap your root with <ReliableProvider> instead. It calls init() once on mount and exposes the client through context for hooks and the error boundary.
// app/layout.tsx (Next.js App Router)
// or _app.tsx (Pages Router) / src/main.tsx (Vite)
import { ReliableProvider } from '@reliableapp/react';
export default function RootLayout({ children }) {
return (
<html>
<body>
<ReliableProvider config={{ publicKey: 'pk_live_rl_xxxxxxxxxxxxxxxx' }}>
{children}
</ReliableProvider>
</body>
</html>
);
}3. Identify your users (optional)#
Tying events to a user is what turns "239 errors today" into "Jane Doe at acme.com hit 4 errors at checkout." Call identify() after the user logs in.
import { identify } from '@reliableapp/frontend-core';
identify({
externalId: 'user_abc123',
email: 'jane@acme.com',
name: 'Jane Doe',
traits: { plan: 'pro', signupDate: '2025-01-12' },
});In React, prefer the useIdentify hook — it handles re-identification when the user changes (e.g. after switching accounts).
4. Verify it's working#
- Open your app in a browser.
- Open DevTools → Network tab. Filter by
reliable. - You should see a
POST /sessionsrequest fire on page load. - Throw a test error in the console:
throw new Error('hello reliable'). - You'll see a
POST /errorsrequest fire moments later. - Switch back to the Reliable dashboard — the error appears in Frontend Health → Errors.
You're done
Not seeing events?
Manually reporting errors#
Auto-capture handles uncaught errors. For caught errors (try/catch branches, validation failures, business logic errors) use captureException:
import { captureException } from '@reliableapp/frontend-core';
try {
await processPayment();
} catch (err) {
captureException(err, {
severity: 'high',
tags: { flow: 'checkout', step: 'payment' },
});
showErrorToast(err.message);
}