Refactoring Provider setup of Google Auth
This commit is contained in:
30
src/lib/services/litProviderSetup.ts
Normal file
30
src/lib/services/litProviderSetup.ts
Normal file
@ -0,0 +1,30 @@
|
||||
// litProviderSetup.ts
|
||||
|
||||
import {
|
||||
LitAuthClient,
|
||||
GoogleProvider,
|
||||
BaseProvider,
|
||||
} from '@lit-protocol/lit-auth-client';
|
||||
import { ProviderType } from '@lit-protocol/constants';
|
||||
import { LitNodeClient } from '@lit-protocol/lit-node-client';
|
||||
|
||||
let provider: BaseProvider | undefined;
|
||||
|
||||
export async function setupLitProvider() {
|
||||
const litNodeClient = new LitNodeClient({
|
||||
litNetwork: 'serrano',
|
||||
debug: false
|
||||
});
|
||||
await litNodeClient.connect();
|
||||
|
||||
const litAuthClient = new LitAuthClient({
|
||||
litRelayConfig: {
|
||||
relayApiKey: 'test-api-key'
|
||||
},
|
||||
litNodeClient
|
||||
});
|
||||
|
||||
provider = litAuthClient.initProvider<GoogleProvider>(ProviderType.Google);
|
||||
|
||||
return provider;
|
||||
}
|
Reference in New Issue
Block a user