@@ -190,12 +190,11 @@ const auth0 = new Auth0({
190190 clientId: ' YOUR_AUTH0_CLIENT_ID' ,
191191 headers: {
192192 ' Accept-Language' : ' fr-CA' ,
193- ' X-Tracking-Id' : ' user-tracking-id-123'
194- }
193+ ' X-Tracking-Id' : ' user-tracking-id-123' ,
194+ },
195195});
196196```
197197
198-
199198#### Using custom headers with Auth0Provider component
200199
201200If you're using the hooks-based approach with Auth0Provider, you can provide headers during initialization:
@@ -209,31 +208,31 @@ import { Auth0Provider } from 'react-native-auth0';
209208 clientId= {' YOUR_CLIENT_ID' }
210209 headers= {{
211210 ' Accept-Language' : ' fr-CA' ,
212- ' X-App-Version' : ' 1.2.3'
211+ ' X-App-Version' : ' 1.2.3' ,
213212 }}
214213>
215214 < App / >
216- < / Auth0Provider>
215+ < / Auth0Provider> ;
217216```
218217
219-
220218#### Set request-specific headers
221219
222220You can also provide headers for specific API calls, which will override global headers with the same name:
223221
224222``` js
225223// For specific authentication requests
226- auth0 .auth .passwordRealm ({
227- username: ' info@auth0.com' ,
228- password: ' password' ,
229- realm: ' myconnection' ,
230- headers: {
231- ' X-Custom-Header' : ' request-specific-value' ,
232- ' X-Request-ID' : ' unique-request-id-456'
233- }
234- })
235- .then (console .log )
236- .catch (console .error );
224+ auth0 .auth
225+ .passwordRealm ({
226+ username: ' info@auth0.com' ,
227+ password: ' password' ,
228+ realm: ' myconnection' ,
229+ headers: {
230+ ' X-Custom-Header' : ' request-specific-value' ,
231+ ' X-Request-ID' : ' unique-request-id-456' ,
232+ },
233+ })
234+ .then (console .log )
235+ .catch (console .error );
237236```
238237
239238## Management API (Users)
0 commit comments