skipLink.label

Interface: NativeAuthRepository

Defined in: repositories/authRepository.native.ts:30

Chanomhub SDK - React Native Entry Point

This entry point provides React Native specific functionality that requires native dependencies like react-native-app-auth.

import { createChanomhubClient } from '@chanomhub/sdk';
import { createNativeAuthRepository } from '@chanomhub/sdk/native';
const sdk = createChanomhubClient();
const nativeAuth = createNativeAuthRepository(sdk.rest, sdk.config);
// Sign in with Google on React Native
const result = await nativeAuth.signInWithGoogleNative({
googleClientId: 'your-google-client-id',
redirectUri: 'com.yourapp:/oauth2redirect',
});

exchangeOAuthToken()

heading.anchorLabel
exchangeOAuthToken(oauthResult): Promise<LoginResponse | null>;

Defined in: repositories/authRepository.native.ts:61

Exchange OAuth token from react-native-app-auth with backend. Use this if you handle the OAuth flow yourself.

ParameterTypeDescription
oauthResultNativeOAuthResultResult from react-native-app-auth authorize()

Promise<LoginResponse | null>

Login response with user and backend tokens


signInWithGoogleNative()

heading.anchorLabel
signInWithGoogleNative(nativeConfig, options?): Promise<LoginResponse | null>;

Defined in: repositories/authRepository.native.ts:37

Sign in with Google OAuth for React Native apps.

ParameterTypeDescription
nativeConfigNativeOAuthConfigNative OAuth configuration with client IDs and redirect URI
options?NativeOAuthOptionsAdditional options like scopes

Promise<LoginResponse | null>

Login response with user and tokens from backend


signInWithProviderNative()

heading.anchorLabel
signInWithProviderNative(
provider,
nativeConfig,
options?): Promise<LoginResponse | null>;

Defined in: repositories/authRepository.native.ts:49

Sign in with any OAuth provider for React Native apps.

ParameterTypeDescription
providerOAuthProviderOAuth provider (google, discord, github)
nativeConfigNativeOAuthConfigNative OAuth configuration
options?NativeOAuthOptionsAdditional options

Promise<LoginResponse | null>

Login response with user and tokens from backend