FAQ
Will this slow my application down?
No — SimpleLogs is designed to have negligible impact on your app's performance.
On the client, log calls are synchronous in-memory writes to a local queue. The queue flushes to the SimpleLogs API in the background using navigator.sendBeacon, which is fire-and-forget and does not block rendering, navigation, or user interactions. There is no round-trip that your application waits on.
On the server, entries are batched and flushed every 250 ms by default (configurable via batchInterval). In serverless environments like Vercel, the SDK switches to immediate-flush mode to avoid losing data at the end of a function invocation. In that case, each log call does trigger a fetch, so the cost is one network request per invocation.
On the SimpleLogs side, the ingestion endpoint is designed to return as fast as possible — it queues the incoming log data immediately and responds without waiting for any processing to complete. This means even in serverless mode, the fetch your server makes returns quickly.
In all cases, logging is off the critical path for your users.
Is my server API key safe?
Yes, as long as you follow the standard Next.js pattern of keeping server API keys in server-only code. The SDK's server and client modules are intentionally separated (@simplelogs/next/server vs. the client exports) so your serverKey never ends up in the browser bundle.
Client keys are designed to be public-facing and can be restricted to specific origins in the SimpleLogs dashboard under Settings → API Keys.
Do I need to use the Next.js SDK?
No. The @simplelogs/next package is a convenience wrapper, but SimpleLogs exposes a standard REST ingestion API that accepts JSON over HTTP. You can send logs from any language, runtime, or framework.
What happens if the API is unreachable?
By default, the client queue uses sendBeacon (fireAndForget: true), which means failed sends are not retried. If delivery reliability matters more than performance, set fireAndForget: false — failed sends will be re-queued and retried on the next flush interval.
The server-side queue always uses fetch and awaits the response. Errors are surfaced as thrown exceptions, so you can handle them however your application's error boundaries expect.
Can I use SimpleLogs with React Server Components?
Yes. The <SimpleLogsProvider> is itself a React Server Component — it configures the server-side SDK during RSC rendering, then passes the client config down via React Context to client components. See Architecture & Integration Patterns for details.
Still have questions?
Email us at support@simplelogs.io.