Skip to content

Commit 9397b0b

Browse files
[fern-replay] Applied customizations
Patches applied (1): - patch-066ff9e0: docs: add v6 migration guide for breaking changes in v6.0.0 (#1368)
1 parent c46cc13 commit 9397b0b

2 files changed

Lines changed: 284 additions & 2 deletions

File tree

.fern/replay.lock

Lines changed: 198 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v6_MIGRATION_GUIDE.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# V6 Migration Guide
2+
3+
A guide to migrating the Auth0 Node.js SDK from `5.x` to `6.x`.
4+
5+
- [Overall changes](#overall-changes)
6+
- [Breaking changes](#breaking-changes)
7+
- [ConnectionAttributeIdentifier replaced with identifier-specific types](#connectionattributeidentifier-replaced-with-identifier-specific-types)
8+
- [PhoneProviderProtectionBackoffStrategyEnum value change](#phoneproviderprotectionbackoffstrategyenum-value-change)
9+
10+
## Overall changes
11+
12+
V6 is a focused release that addresses type correctness for database connection attribute identifiers and aligns the phone provider backoff strategy enum with the updated API. There are no changes to the Authentication API — any code written for the Authentication API in `5.x` will continue to work in `6.x`.
13+
14+
## Breaking changes
15+
16+
### ConnectionAttributeIdentifier replaced with identifier-specific types
17+
18+
In v5, all three attribute identifiers (email, phone number, and username) shared a single `ConnectionAttributeIdentifier` type for their `identifier` field. This was incorrect — each identifier type supports different values for `default_method`.
19+
20+
In v6, `ConnectionAttributeIdentifier` has been removed and replaced with three separate types:
21+
22+
| Attribute | Old type | New type | `default_method` values |
23+
| -------------- | ------------------------------- | ----------------------------- | ----------------------------- |
24+
| `email` | `ConnectionAttributeIdentifier` | `EmailAttributeIdentifier` | `"password"` \| `"email_otp"` |
25+
| `phone_number` | `ConnectionAttributeIdentifier` | `PhoneAttributeIdentifier` | `"password"` \| `"phone_otp"` |
26+
| `username` | `ConnectionAttributeIdentifier` | `UsernameAttributeIdentifier` | _(no `default_method`)_ |
27+
28+
**Before (v5):**
29+
30+
```ts
31+
import { Management } from "auth0";
32+
33+
const identifier: Management.ConnectionAttributeIdentifier = {
34+
active: true,
35+
default_method: "email_otp",
36+
};
37+
```
38+
39+
**After (v6):**
40+
41+
```ts
42+
import { Management } from "auth0";
43+
44+
// For email attribute
45+
const emailIdentifier: Management.EmailAttributeIdentifier = {
46+
active: true,
47+
default_method: "email_otp",
48+
};
49+
50+
// For phone_number attribute
51+
const phoneIdentifier: Management.PhoneAttributeIdentifier = {
52+
active: true,
53+
default_method: "phone_otp",
54+
};
55+
56+
// For username attribute (no default_method)
57+
const usernameIdentifier: Management.UsernameAttributeIdentifier = {
58+
active: true,
59+
};
60+
```
61+
62+
If you were using `ConnectionAttributeIdentifier` as a type annotation in your own code, update it to the appropriate identifier-specific type based on which attribute it applies to.
63+
64+
---
65+
66+
### PhoneProviderProtectionBackoffStrategyEnum value change
67+
68+
The `PhoneProviderProtectionBackoffStrategyEnum` enum has been updated to reflect a change in the Auth0 API. The `None` variant has been renamed to `Default`, and its string value has changed from `"none"` to `"default"`.
69+
70+
**Before (v5):**
71+
72+
```ts
73+
import { Management } from "auth0";
74+
75+
const strategy = Management.PhoneProviderProtectionBackoffStrategyEnum.None; // "none"
76+
```
77+
78+
**After (v6):**
79+
80+
```ts
81+
import { Management } from "auth0";
82+
83+
const strategy = Management.PhoneProviderProtectionBackoffStrategyEnum.Default; // "default"
84+
```
85+
86+
If you were passing this value directly as a string `"none"`, update it to `"default"` to match the updated API.

0 commit comments

Comments
 (0)