Skip to content

Commit 5790c16

Browse files
Merge pull request #409 from KeeganBeuthin/update-react-sdk-references
first revision of updated react sdk refs
2 parents a490f1f + f490d6a commit 5790c16

File tree

5 files changed

+21
-29
lines changed

5 files changed

+21
-29
lines changed

src/content/docs/authenticate/custom-configurations/custom-authentication-pages.mdx

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,13 @@ There are different steps depending on the authentication method you use. Update
7878

7979
### Social sign in
8080

81-
Add the `connection_id` to the auth url. Here is an example using React:
81+
Add the `connectionId` to the auth url. Here is an example using React:
8282

8383
```jsx
8484
<button
8585
onClick={() =>
8686
login({
87-
authUrlParams: {
88-
connection_id: "conn_6a95dec504d34dc286dc80e8df9f6099"
89-
}
87+
connectionId: "conn_6a95dec504d34dc286dc80e8df9f6099"
9088
})
9189
}
9290
>
@@ -98,7 +96,7 @@ You can now test if it works by signing in to your project or app.
9896

9997
### Email sign in
10098

101-
Add the `connection_id` and `login_hint` params to the auth url.
99+
Add the `connectionId` and `loginHint` params to the auth url.
102100

103101
The `login_hint` enables you to pre-populate the email for the user, skipping the step where they have to enter their identity/email. It also tells us where to send their one time password for passwordless verification.
104102

@@ -108,10 +106,8 @@ Here is an example using React.
108106
<button
109107
onClick={() =>
110108
login({
111-
authUrlParams: {
112-
connection_id: "conn_e5f80aa5258e4685bf629b38003ee954"
113-
login_hint: "[email protected]"
114-
}
109+
connectionId: "conn_e5f80aa5258e4685bf629b38003ee954",
110+
loginHint: "[email protected]"
115111
})
116112
}
117113
>
@@ -123,22 +119,20 @@ You can now test if it works by signing in to your project or app.
123119

124120
### Phone sign in
125121

126-
Add `connection_id` and `login_hint` params to the auth url.
122+
Add `connectionId` and `loginHint` params to the auth url.
127123

128-
The `login_hint` enables you to pre-populate the phone for the user, skipping the step where they have to enter their phone number. It also tells us where to send their one time password for passwordless verification.
124+
The `loginHint` enables you to pre-populate the phone for the user, skipping the step where they have to enter their phone number. It also tells us where to send their one time password for passwordless verification.
129125

130-
The `login_hint` needs to be in one of these formats `phone:<intl_number>:<country_code>` or `phone:<+intl_number>:<country_code>`. The ‘+’ symbol is optional, as long as the country code is included.
126+
The `loginHint` needs to be in one of these formats `phone:<intl_number>:<country_code>` or `phone:<+intl_number>:<country_code>`. The ‘+’ symbol is optional, as long as the country code is included.
131127

132128
Here is an example using React:
133129

134130
```jsx
135131
<button
136132
onClick={() =>
137133
login({
138-
authUrlParams: {
139-
connection_id: "conn_e1d49977648149a2a32fde844f1ff9e5"
140-
login_hint: "phone:+61466043123:au"
141-
}
134+
connectionId: "conn_e1d49977648149a2a32fde844f1ff9e5"
135+
loginHint: "phone:+61466043123:au"
142136
})
143137
}
144138
>
@@ -150,15 +144,13 @@ You can now test if it works by signing in to your project or app.
150144

151145
### Enterprise sign in (Entra ID or SAML)
152146

153-
Add the `connection_id` to the auth url. This takes the user directly to the enterprise authentication process. Here is an example using React:
147+
Add the `connectionId` to the auth url. This takes the user directly to the enterprise authentication process. Here is an example using React:
154148

155149
```jsx
156150
<button
157151
onClick={() =>
158152
login({
159-
authUrlParams: {
160-
connection_id: "conn_6a95dec504d34dc286dc80e8df9f6099"
161-
}
153+
connectionId: "conn_6a95dec504d34dc286dc80e8df9f6099"
162154
})
163155
}
164156
>

src/content/docs/authenticate/manage-authentication/navigate-between-organizations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ In this example, we’ve also included a check to see if this is the current org
6868
const {getClaim, getOrganization} = useKindeAuth();
6969

7070
<ul>
71-
{getClaim("organizations", "id_token").value.map((item) => (
71+
{getClaim("organizations", "idToken").value.map((item) => (
7272
<li key={item.id}>
73-
<button onClick={() => login({org_code: item.id})} type="button">
73+
<button onClick={() => login({orgCode: item.id})} type="button">
7474
{item.name}
7575
{getOrganization().orgCode === item.id ? " (Current)" : null}
7676
</button>

src/content/docs/build/applications/authenticating-spa.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ This application type does not have a client secret as authentication takes plac
3030
4. This sample is from a React application, but it will be very similar for any frontend technology.
3131

3232
```jsx
33-
const {getToken} = useKindeAuth();
33+
const { getAccessToken } = useKindeAuth();
3434

3535
const fetchData = async () => {
3636
try {
37-
const accessToken = await getToken();
37+
const accessToken = await getAccessToken();
3838
const res = await fetch(`<your_api_endpoint>`, {
3939
headers: {
4040
Authorization: `Bearer ${accessToken}`
@@ -52,7 +52,7 @@ This application type does not have a client secret as authentication takes plac
5252

5353
You do not need to set up a back-end application in Kinde. The request sent to your API will include the access token, which gets validated when you receive it on your back end.
5454

55-
Validation checks the token has not expired and that the token has originated from Kinde, as well as various other checks. While it is possible to write code to check this yourself, it can be easy to miss something and accidentally introduce serious security vulnerabilities. Heres our recommendations:
55+
Validation checks the token has not expired and that the token has originated from Kinde, as well as various other checks. While it is possible to write code to check this yourself, it can be easy to miss something and accidentally introduce serious security vulnerabilities. Here's our recommendations:
5656

5757
- Use the Kinde JWT verifier for your chosen technology (if available). Our Node package is available [here](https://www.npmjs.com/package/@kinde/jwt-validator).
5858

@@ -62,7 +62,7 @@ OR
6262

6363
OR
6464

65-
- Choose a third-party library, for example the OpenID Foundation has [a list of libraries for working with JWT tokens](https://openid.net/developers/jwt/).
65+
- Choose a third-party library, for example the OpenID Foundation has [a list of libraries for working with JWT tokens](https://openid.net/developers/jwt/).
6666

6767
#### Audience
6868

src/content/docs/developer-tools/your-apis/protect-your-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ This ensures the access token you receive when the user signs in, will contain t
2727
When you make the call to your API you will want to ensure the access token is sent in the headers. An example in React for a bookstore app might be:
2828

2929
```jsx
30-
const {getToken} = useKindeAuth();
30+
const { getAccessToken } = useKindeAuth();
3131
const [books, setBooks] = useState([]);
3232

3333
const fetchBooks = async () => {
3434
try {
35-
const accessToken = await getToken();
35+
const accessToken = await getAccessToken();
3636
const res = await fetch(`https://api.myapp.com/books`, {
3737
headers: {
3838
Authorization: `Bearer ${accessToken}`

src/content/docs/properties/work-with-properties/marketing-tags-properties.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@ Likely you will want to see which tags are converting into sign ups and are perf
112112
/api/v1/search/users?query=properties[kp_usr_utm_source]=Hello&properties[kp_usr_campaign]=World
113113
```
114114

115-
The search organizations API is coming soon.
115+
The search organizations API is coming soon.

0 commit comments

Comments
 (0)