Skip to content

Commit abaf615

Browse files
feat(auth0-server-js): send telemetry for every request to auth0
1 parent 89b97b1 commit abaf615

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/auth0-server-js/src/server-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class ServerClient<TStoreOptions = unknown> {
6868
authorizationParams: this.#options.authorizationParams,
6969
customFetch: this.#options.customFetch,
7070
useMtls: this.#options.useMtls,
71+
telemetry: this.#options.telemetry,
7172
});
7273
}
7374

packages/auth0-server-js/src/types.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { AuthorizationDetails } from '@auth0/auth0-auth-js';
1+
import type { AuthorizationDetails, TelemetryConfig } from '@auth0/auth0-auth-js';
2+
3+
export type { TelemetryConfig } from '@auth0/auth0-auth-js';
24

35
export interface ServerClientOptions<TStoreOptions = unknown> {
46
domain: string;
@@ -18,10 +20,16 @@ export interface ServerClientOptions<TStoreOptions = unknown> {
1820

1921
/**
2022
* Indicates whether the SDK should use the mTLS endpoints if they are available.
21-
*
23+
*
2224
* When set to `true`, using a `customFetch` is required.
2325
*/
2426
useMtls?: boolean;
27+
28+
/**
29+
* Optional telemetry configuration.
30+
* Telemetry is enabled by default and sends the Auth0-Client header with package name and version.
31+
*/
32+
telemetry?: TelemetryConfig;
2533
}
2634

2735
export interface UserClaims {

0 commit comments

Comments
 (0)