Skip to content

feat(browser): export initLogtide; dedup framework client init#10

Merged
Polliog merged 1 commit into
mainfrom
fix/issue-9-browser-init-logtide
Jun 28, 2026
Merged

feat(browser): export initLogtide; dedup framework client init#10
Polliog merged 1 commit into
mainfrom
fix/issue-9-browser-init-logtide

Conversation

@Polliog

@Polliog Polliog commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #9 — the React integration docs tell users to import { initLogtide } from '@logtide/browser', but @logtide/browser never exported it, producing Module '"@logtide/browser"' has no exported member 'initLogtide'.

Changes

  • @logtide/browser: new initLogtide(options) export — wires up the global error handler, default browser integrations (click/network breadcrumbs, optional Web Vitals) and offline resilience, then binds the session id to the global scope. Also exports the reusable buildBrowserIntegrations / buildBrowserTransportWrapper helpers.
  • @logtide/nextjs, @logtide/sveltekit, @logtide/angular: client init now delegates to the shared initLogtide (passing their own defaultService), removing ~180 lines of duplicated browser-init logic.
  • Behaviour change: SvelteKit now defaults service to 'sveltekit' when not provided (previously fell back to 'unknown'), aligning it with Next.js ('nextjs') and Angular ('angular'). An explicit service still wins.
  • Bump all packages 0.9.0 → 0.10.0 + CHANGELOG entry.

Tests

TDD: 5 new tests in packages/browser/tests/init.test.ts.

  • @logtide/browser: 46 tests pass, typecheck + build OK
  • @logtide/nextjs (17), @logtide/sveltekit (20), @logtide/angular (7): tests pass, typecheck OK

Add `initLogtide` (and the `buildBrowserIntegrations` /
`buildBrowserTransportWrapper` helpers) to `@logtide/browser`, matching the
React integration docs (`import { initLogtide } from '@logtide/browser'`).

The Next.js, SvelteKit and Angular client init now delegate to the shared
`initLogtide`, removing the duplicated browser-init logic. SvelteKit now
defaults `service` to 'sveltekit' (was 'unknown'), aligning it with Next.js
and Angular.

Bump all packages to 0.10.0.

Fixes #9
@Polliog Polliog merged commit bef881d into main Jun 28, 2026
8 checks passed
@Polliog Polliog deleted the fix/issue-9-browser-init-logtide branch June 28, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module '"@logtide/browser"' has no exported member 'initLogtide'.

1 participant