# 메서드

## login

`login` 변수는 다양한 인증 방법을 포함한 위핀 로그인 라이브러리로, 사용자가 여러 방식으로 로그인할 수 있도록 합니다. 이메일 및 비밀번호 로그인, OAuth 프로바이더 로그인, ID Token 또는 Access Token을 사용한 로그인 등을 지원합니다. 각 메서드에 대한 자세한 정보는 공식 라이브러리 문서  [Login Library 가이드](/widget-integration/react-native-sdk/login-library.md)에서 확인할 수 있습니다.

#### **Available Methods**

* `loginWithOauthProvider`
* `signUpWithEmailAndPassword`
* `loginWithEmailAndPassword`
* `loginWithIdToken`
* `loginWithAccessToken`
* `getRefreshFirebaseToken`
* `loginWepin`
* `getCurrentWepinUser`
* `logout`
* `getSignForLogin`

이 메서드들은 다양한 로그인 시나리오를 지원하며, 필요에 맞는 적절한 방법을 선택할 수 있습니다.

#### **Example**

```javascript
// Login using an OAuth provider
const oauthResult = await wepinProvider.login.loginWithOauthProvider({
  provider: 'google',
  clientId: 'your-client-id',
});

// Sign up and log in using email and password
const signUpResult = await wepinProvider.login.signUpWithEmailAndPassword(
  'example@example.com',
  'password123'
);

// Log in to Wepin
const wepinLoginResult = await wepinProvider.login.loginWepin(signUpResult);

// Get the currently logged-in user
const currentUser = await wepinProvider.login.getCurrentWepinUser();

// Logout
await wepinProvider.login.logout();
```

## getProvider

```javascript
await wepinProvider.getProvider(network);
```

Network에 해당하는 Provider를 반환합니다.

#### **Parameters**

* `network` \<string> - 위핀이 지원하는 Provider의 Network Variable 값으로 Network Variable은 소문자로 입력해야 합니다. (e.g., "ethereum", "klaytn", "kaia")

#### **Return value**

* Promise\<BaseProvider> - A EIP-1193 compatible provider

#### **Example**

```javascript
const provider = await wepinProvider.getProvider('ethereum');
```

## finalize

```javascript
await wepinProvider.finalize();
```

WepinProvider 사용을 종료합니다.

#### **Parameters**

* None

#### **Return value**

* Promise\<void>

#### **Example**

```javascript
await wepinProvider.finalize();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wepin.io/widget-integration/react-native-sdk/provider/methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
