You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -76,9 +76,9 @@ You can also check out our starter kits on GitHub:
76
76
77
77
## Before you begin
78
78
79
-
- If you haven’t already got a Kinde account, [register for free here](https://app.kinde.com/register) (no credit card required). Registering gives you a Kinde domain, which you need to get started, e.g. `yourapp.kinde.com`.
79
+
- If you haven't already got a Kinde account, [register for free here](https://app.kinde.com/register) (no credit card required). Registering gives you a Kinde domain, which you need to get started, e.g. `yourapp.kinde.com`.
80
80
- You will also need Node, the React Native command line interface, a JDK, Android Studio (for Android) and Xcode (for iOS).
81
-
- Follow[the installation instructions for your chosen OS](https://reactnative.dev/docs/environment-setup)to install dependencies.
81
+
- Follow[the installation instructions for your chosen OS](https://reactnative.dev/docs/environment-setup)to install dependencies.
82
82
83
83
<Asidetype="warning"title="Important">
84
84
@@ -104,6 +104,27 @@ Because the Kinde SDK requires React Native 0.60 or higher, native dependencies
104
104
105
105
### **iOS**
106
106
107
+
Before installing CocoaPods, ensure you have Ruby and Bundler set up correctly on your system.
108
+
109
+
### Shell setup
110
+
111
+
```shell
112
+
# Install or update Bundler
113
+
gem install bundler
114
+
115
+
# Create a new Gemfile if it doesn't exist
116
+
bundle init
117
+
118
+
# Add CocoaPods to your Gemfile
119
+
bundle add cocoapods
120
+
121
+
# Install dependencies using Bundler
122
+
bundle install
123
+
124
+
# Install pods for your project
125
+
cd ios && bundle exec pod install
126
+
```
127
+
107
128
#### Update iOS native dependencies
108
129
To update iOS native dependencies, you can use **CocoaPods**. We recommend installing **CocoaPods** using [Homebrew](https://brew.sh/).
109
130
@@ -116,18 +137,18 @@ cd ios && pod install
116
137
117
138
If you encounter any errors during the SDK installation process, you can refer to the General Tips section at the end of this topic.
118
139
119
-
## K**inde configuration**
140
+
## Kinde configuration
120
141
121
-
1. In Kinde, go to**Settings> Applications.**
122
-
2. Select **View details** on the**Front-end app**.
123
-
3. Scroll down to the**Callback URLs**section.
142
+
1. In Kinde, go to**Settings> Applications.**
143
+
2. Select **View details** on the**Front-end app**.
144
+
3. Scroll down to the**Callback URLs**section.
124
145
4. Add in the callback URLs for your React Native app, which should look something like this:
Make sure you press the Save button at the bottom of the page!
129
150
130
-
Note: The`myapp://myhost.kinde.com/kinde_callback`is used as an example of local URL Scheme, change to the local local URL Scheme that you use.
151
+
Note: The`myapp://myhost.kinde.com/kinde_callback`is used as an example of local URL Scheme, change to the local local URL Scheme that you use.
131
152
132
153
## Environments
133
154
@@ -139,10 +160,10 @@ If you would like to use our Environments feature as part of your development pr
139
160
140
161
Put these variables in your .env file. You can find these variables on the same page as where you set the callback URLs.
141
162
142
-
-`KINDE_ISSUER_URL`- your Kinde domain
143
-
-`KINDE_POST_CALLBACK_URL`- After the user authenticates we will callback to this address. Make sure this URL is under your allowed callback URLs
144
-
-`KINDE_POST_LOGOUT_REDIRECT_URL`- where you want users to be redirected to after logging out. Make sure this URL is under your allowed logout redirect URLs
145
-
-`KINDE_CLIENT_ID`- you can find this on the App Keys page
163
+
-`KINDE_ISSUER_URL`- your Kinde domain
164
+
-`KINDE_POST_CALLBACK_URL`- After the user authenticates we will callback to this address. Make sure this URL is under your allowed callback URLs
165
+
-`KINDE_POST_LOGOUT_REDIRECT_URL`- where you want users to be redirected to after logging out. Make sure this URL is under your allowed logout redirect URLs
166
+
-`KINDE_CLIENT_ID`- you can find this on the App Keys page
The KindeProvider is a powerful component introduced in React Native SDK 0.7x that simplifies session management and SDK initialization. It handles the complexity of user session lifecycles on mobile devices, including token validation and refresh logic.
The `useKindeProvider` hook initializes the SDK if it hasn't been initialized and returns a cached instance if it has. It also provides session state information and a reference to the SDK client.
-`isAuthenticated`: A boolean indicating the current authentication state
395
+
-`verifyToken`: A function to verify the token's validity
396
+
-`authSdk`: A reference to the initialized KindeSDK instance
397
+
398
+
This approach simplifies session management by:
399
+
- Automatically handling SDK initialization
400
+
- Caching the SDK instance appropriately
401
+
- Managing token validation and refresh logic
402
+
- Providing easy access to authentication state
403
+
349
404
## Sign in and registration
350
405
351
406
Kinde provides methods for easily implementing a login / register flow. You can add buttons as follows.
@@ -363,7 +418,7 @@ Kinde provides methods for easily implementing a login / register flow. You can
363
418
364
419
Then define new functions that match for each button.
365
420
366
-
**Note**: Before proceeding, make sure you’ve defined the **KindeSDK** as a **client** variable.
421
+
**Note**: Before proceeding, make sure you've defined the **KindeSDK** as a **client** variable.
367
422
368
423
```typescript
369
424
...
@@ -478,7 +533,7 @@ Go to the Users page in Kinde to see your newly registered user.
478
533
479
534
Once a user has been verified, your product/application will return the JWT token with an array of permissions for that user. You will need to configure your product/application to read permissions and unlock the respective functions.
480
535
481
-
[Set permissions](/manage-users/roles-and-permissions/user-permissions/) in your Kinde account. Here’s an example set of permissions.
536
+
[Set permissions](/manage-users/roles-and-permissions/user-permissions/) in your Kinde account. Here's an example set of permissions.
482
537
483
538
```typescript
484
539
const permissions = [
@@ -513,7 +568,7 @@ if ((await client.getPermission("create:todos")).isGranted) {
513
568
514
569
## Audience
515
570
516
-
Anaudienceis the intended recipient of an access token - for example the API for your application. The audience argument can be passed to the Kinde client to request an audience be added to the token.
571
+
Anaudienceis the intended recipient of an access token - for example the API for your application. The audience argument can be passed to the Kinde client to request an audience be added to the token.
517
572
518
573
The audience of a token is the intended recipient of the token.
519
574
@@ -530,7 +585,7 @@ const client = new KindeSDK(
530
585
);
531
586
```
532
587
533
-
For details on how to connect, see[Register an API](/developer-tools/your-apis/register-manage-apis/).
588
+
For details on how to connect, see[Register an API](/developer-tools/your-apis/register-manage-apis/).
Once the user has successfully authenticated, you'll have a JWT and a refresh token and that has been stored securely. E.g. using the`getAccessToken`method ofthe`Storage`class to get an access token.
817
+
Once the user has successfully authenticated, you'll have a JWT and a refresh token and that has been stored securely. E.g. using the`getAccessToken`method ofthe`Storage`class to get an access token.
@@ -1263,9 +1318,9 @@ If you got the error **'value' is unavailable: introduced in iOS 12.0** when t
1263
1318
decoding="async"
1264
1319
/>
1265
1320
1266
-
6. Dependency`'androidx.browser:browser:1.6.0-beta01'`requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs
1321
+
6. Dependency`'androidx.browser:browser:1.6.0-beta01'`requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs
1267
1322
1268
-
The solution is add`androidXBrowser = "1.4.0"`in your project.
1323
+
The solution is add`androidXBrowser = "1.4.0"`in your project.
1269
1324
1270
1325
```java
1271
1326
// android/build.gradle
@@ -1282,7 +1337,7 @@ If you got the error **'value' is unavailable: introduced in iOS 12.0** when t
1282
1337
1283
1338
7. Duplicate class **kotlin.collections.jdk8.CollectionsJDK8Kt** found in modules **jetified-kotlin-stdlib-1.8.10** (org.jetbrains.kotlin:kotlin-stdlib:1.8.10) and **jetified-kotlin-stdlib-jdk8-1.7.22** (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.22)
1284
1339
1285
-
The solution is add`org.jetbrains.kotlin:kotlin-bom:1.8.0`dependency in your project.
1340
+
The solution is add`org.jetbrains.kotlin:kotlin-bom:1.8.0`dependency in your project.
0 commit comments