In This Article
useWixAuth()
The useWixAuth()
hook returns the authentication strategy of the enclosing WixProvider, such as OAuthStrategy
or APIKeyStrategy
.
Note: This hook must be used inside an enclosing WixProvider component.
Example
Copy
1import { useWixAuth } from '@wix/sdk-react';2
3//...4
5const { generateVisitorTokens } = useWixAuth() as IOAuthStrategy;6
7//...8
9const { accessToken, refreshToken } = await generateVisitorTokens();
Was this helpful?
Yes
No