Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ eslint.config.mjs
.husky/

.prettierignore
CONTRIBUTING.md
CONTRIBUTING.md
.fern/
11 changes: 0 additions & 11 deletions .npmignore

This file was deleted.

44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,48 @@ const response = await client.actions.create(
controller.abort(); // aborts the request
```

### Logging

The SDK supports configurable logging for debugging API requests and responses. By default, logging is silent.

```typescript
import { ManagementClient } from "auth0";

const client = new ManagementClient({
domain: "your-tenant.auth0.com",
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
logging: {
level: "debug", // "debug" | "info" | "warn" | "error"
silent: false, // Set to false to enable logging output
},
});
```

You can also provide a custom logger implementation:

```typescript
import { ManagementClient } from "auth0";

const customLogger = {
debug: (msg, ...args) => myLogger.debug(msg, args),
info: (msg, ...args) => myLogger.info(msg, args),
warn: (msg, ...args) => myLogger.warn(msg, args),
error: (msg, ...args) => myLogger.error(msg, args),
};

const client = new ManagementClient({
domain: "your-tenant.auth0.com",
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
logging: {
level: "info",
logger: customLogger,
silent: false,
},
});
```

### Access Raw Response Data

The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.
Expand Down Expand Up @@ -582,4 +624,4 @@ Please do not report security vulnerabilities on the public GitHub issue tracker
</p>
<p align="center">
This project is licensed under the MIT license. See the <a href="./LICENSE"> LICENSE</a> file for more info.
</p>
</p>
33 changes: 26 additions & 7 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,47 @@ export default {
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/src/management/tests"],
testPathIgnorePatterns: ["\.browser\.(spec|test)\.[jt]sx?$", "/tests/wire/"],
setupFilesAfterEnv: [],
testPathIgnorePatterns: ["/tests/wire/"],
setupFilesAfterEnv: ["<rootDir>/src/management/tests/setup.ts"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: "<rootDir>/src/management/tests/tsconfig.json",
},
],
},
},
{
displayName: "wire",
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/src/management/tests/wire"],
setupFilesAfterEnv: ["<rootDir>/src/management/tests/mock-server/setup.ts"],
setupFilesAfterEnv: [
"<rootDir>/src/management/tests/setup.ts",
"<rootDir>/src/management/tests/mock-server/setup.ts",
],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: "<rootDir>/src/management/tests/tsconfig.json",
},
],
},
},
{
displayName: "root-tests",
preset: "ts-jest/presets/default-esm",
testEnvironment: "node",
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"^(\.{1,2}/.*)\.js$": "$1",
},
extensionsToTreatAsEsm: [".ts"],
transform: {
Expand All @@ -69,4 +88,4 @@ export default {
],
workerThreads: false,
passWithNoTests: true,
};
};
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
"precommit": "lint-staged",
"validate": "yarn lint:check && yarn format --check && yarn build && yarn test && yarn lint:package"
},
"dependencies": {
"uuid": "^11.1.0",
"jose": "^4.13.2",
"auth0-legacy": "npm:auth0@^4.27.0"
},
"devDependencies": {
"webpack": "^5.97.1",
"ts-loader": "^9.5.1",
Expand Down Expand Up @@ -130,10 +135,5 @@
"*.{json,md,yml,yaml}": [
"prettier --write"
]
},
"dependencies": {
"uuid": "^11.1.0",
"jose": "^4.13.2",
"auth0-legacy": "npm:auth0@^4.27.0"
}
}
Loading
Loading