### Usage
#### Initialize sign in
``tsx`
document.location = getSignInUrl({
authPath: 'https://auth.ankr.com/',
appPath: 'ankr.com/rpc/auth/',
appId: 'MultiRPC',
referralCode: 'foobar',
hasReferralCodeBox: true,
hasClickwrapAgreement: true,
hasAPIKeysNotification: true,
referrer: window.location.href,
});
#### Get access token and init getaways
`tsx
import {
getPermanentAccessTokenWithCookie,
getSignInUrl,
signOutAndClearCookies,
useAuth,
} from '@ankr.com/auth';
export const gateways = createGateways({ baseURL: 'https://api.project.com/v1/' });
export function Component({ children }: IAppBaseProps): JSX.Element {
const { isSignedIn } = useAuth({
appId: 'MultiRPC',
getPermanentAccessToken: getPermanentAccessTokenWithCookie,
signOutFromAPI: signOutAndClearCookies,
gateways,
customAuthAPIBaseURL: https://api.project.com/v2/,``
});
const getUser = () => {
void gateways.auth.get('/getUser');;
};
if (isSignedIn === undefined) {
return
} else {
getUser();
}
return null;
}