Skip to content

Commit

Permalink
Update docs/backend-requests/making/cross-origin.mdx
Browse files Browse the repository at this point in the history
Co-authored-by: Alexis Aguilar <[email protected]>
  • Loading branch information
victoriaxyz and alexisintech authored Nov 13, 2024
1 parent 03159c0 commit 5cf0161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/backend-requests/making/cross-origin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function useFetch() {

## `useSWR()` hook

If you are using React or Next.js and want to use the [`useSWR`](https://swr.vercel.app/) hook, you can create a custom hook by using the [`useAuth()`](/docs/references/react/use-auth) hook. `useAuth()` returns the asynchronous `getToken` function that can be called to add the session token as a Bearer token in the Authorization header of requests.
If you are using React or Next.js and want to use SWR's [`useSWR()`](https://swr.vercel.app/) hook, you can create a custom hook by using the [`useAuth()`](/docs/references/react/use-auth) hook. `useAuth()` returns the asynchronous `getToken()` method that can be called to add the session token as a Bearer token in the Authorization header of requests.

```js
import useSWR from 'swr'
Expand Down

0 comments on commit 5cf0161

Please sign in to comment.