useWixAuth()

Deprecated

This hook is deprecated. For more information, see Migrating from sdk-react.

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
import { useWixAuth } from '@wix/sdk-react'; //... const { generateVisitorTokens } = useWixAuth() as IOAuthStrategy; //... const { accessToken, refreshToken } = await generateVisitorTokens();
Did this help?