Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions common/api-review/crashlytics-angular.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

```ts

import { DestroyRef } from '@angular/core';
import { ErrorHandler } from '@angular/core';
import { FirebaseApp } from '@firebase/app';
import { Router } from '@angular/router';

// @public
export interface Crashlytics {
Expand All @@ -27,6 +29,9 @@ export class FirebaseErrorHandler implements ErrorHandler {
handleError(error: unknown): void;
}

// @public
export function setupNavigationTracking(app: FirebaseApp, router: Router, destroyRef: DestroyRef, crashlyticsOptions?: CrashlyticsOptions): void;


// (No @packageDocumentation comment for this package)

Expand Down
3 changes: 0 additions & 3 deletions common/api-review/crashlytics-next-navigation.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ export interface CrashlyticsOptions {
tracingUrl?: string;
}

// @public
export function getParameterizedRoute(pathname: string | null, params: Record<string, string | string[] | undefined> | null): string;


// (No @packageDocumentation comment for this package)

Expand Down
60 changes: 60 additions & 0 deletions docs-devsite/crashlytics_angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ https://github.com/firebase/firebase-js-sdk

# @firebase/crashlytics/angular

## Functions

| Function | Description |
| --- | --- |
| [setupNavigationTracking(app, router, destroyRef, crashlyticsOptions)](./crashlytics_angular.md#setupnavigationtracking_93fc190) | Configures automatic Angular router navigation tracking for Firebase Crashlytics.<!-- -->This function subscribes to router navigation events, keeps the Crashlytics route path attribute updated, and logs view boundary telemetry automatically. |

## Classes

| Class | Description |
Expand All @@ -24,3 +30,57 @@ https://github.com/firebase/firebase-js-sdk
| [Crashlytics](./crashlytics_angular.crashlytics.md#crashlytics_interface) | An instance of the Firebase Crashlytics SDK.<!-- -->Do not create this instance directly. Instead, use [getCrashlytics()](./crashlytics_.md#getcrashlytics_a9d22a1)<!-- -->. |
| [CrashlyticsOptions](./crashlytics_angular.crashlyticsoptions.md#crashlyticsoptions_interface) | Options for initializing the Crashlytics service using [getCrashlytics()](./crashlytics_.md#getcrashlytics_a9d22a1)<!-- -->. |

## function(app, ...)

### setupNavigationTracking(app, router, destroyRef, crashlyticsOptions) {:#setupnavigationtracking_93fc190}

Configures automatic Angular router navigation tracking for Firebase Crashlytics.

This function subscribes to router navigation events, keeps the Crashlytics route path attribute updated, and logs view boundary telemetry automatically.

<b>Signature:</b>

```typescript
export declare function setupNavigationTracking(app: FirebaseApp, router: Router, destroyRef: DestroyRef, crashlyticsOptions?: CrashlyticsOptions): void;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance to use. |
| router | Router | The Angular instance to subscribe to. |
| destroyRef | DestroyRef | The instance to bind teardown logic to. |
| crashlyticsOptions | [CrashlyticsOptions](./crashlytics_.crashlyticsoptions.md#crashlyticsoptions_interface) | Optional. [CrashlyticsOptions](./crashlytics_.crashlyticsoptions.md#crashlyticsoptions_interface) that configure the Crashlytics instance. |

<b>Returns:</b>

void

### Example


```typescript
import { ApplicationConfig, ErrorHandler, inject, DestroyRef } from '@angular/core';
import { Router } from '@angular/router';
import { FirebaseErrorHandler, setupNavigationTracking } from '@firebase/crashlytics/angular';

export const appConfig: ApplicationConfig = {
providers: [
{
provide: ErrorHandler,
useFactory: () => new FirebaseErrorHandler(firebaseApp)
},
provideEnvironmentInitializer(() => {
inject(ErrorHandler);
setupNavigationTracking(
firebaseApp,
inject(Router),
inject(DestroyRef)
);
})
]
};

```

30 changes: 0 additions & 30 deletions docs-devsite/crashlytics_next-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ https://github.com/firebase/firebase-js-sdk

| Function | Description |
| --- | --- |
| <b>function({ firebaseApp, crashlyticsOptions }, ...)</b> |
| [CrashlyticsNavigationTracker({ firebaseApp, crashlyticsOptions })](./crashlytics_next-navigation.md#crashlyticsnavigationtracker_c141224) | A client-side routing component for Next.js App Router that automatically captures navigation events and updates route attributes.<!-- -->This component should be mounted inside a root Client Component layout. |
| <b>function(pathname, ...)</b> |
| [getParameterizedRoute(pathname, params)](./crashlytics_next-navigation.md#getparameterizedroute_3fcbe19) | Constructs a parameterized route template for Next.js App Router by replacing dynamic parameter values in the pathname with parameter placeholders. |

## Interfaces

Expand Down Expand Up @@ -74,30 +71,3 @@ export default function RootLayout({ children }) {

```

## function(pathname, ...)

### getParameterizedRoute(pathname, params) {:#getparameterizedroute_3fcbe19}

Constructs a parameterized route template for Next.js App Router by replacing dynamic parameter values in the pathname with parameter placeholders.

<b>Signature:</b>

```typescript
export declare function getParameterizedRoute(pathname: string | null, params: Record<string, string | string[] | undefined> | null): string;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| pathname | string \| null | |
| params | Record&lt;string, string \| string\[\] \| undefined&gt; \| null | |

<b>Returns:</b>

string

### Example

// pathname = "/users/123/details", params = { id: "123" } // returns "/users/:id/details"

Loading
Loading