Skip to content

Commit e9a09c1

Browse files
docs: Unresolved reference in docs (#14231)
* fix: Unresolved reference in docs * fix
1 parent d4f00a1 commit e9a09c1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

documentation/docs/30-advanced/68-observability.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,20 @@ SvelteKit provides access to the `root` span and the `current` span on the reque
4343

4444
```js
4545
/// file: $lib/authenticate.ts
46+
47+
// @filename: ambient.d.ts
48+
declare module '$lib/auth-core' {
49+
export function getAuthenticatedUser(): Promise<{ id: string }>
50+
}
51+
52+
// @filename: index.js
53+
// ---cut---
54+
import { getRequestEvent } from '$app/server';
55+
import { getAuthenticatedUser } from '$lib/auth-core';
56+
4657
async function authenticate() {
58+
const user = await getAuthenticatedUser();
4759
const event = getRequestEvent();
48-
const user = await getAuthenticatedUser(event);
4960
event.tracing.root.setAttribute('userId', user.id);
5061
}
5162
```

0 commit comments

Comments
 (0)