# `OAuthApplication`

The `OAuthApplication` object provides helpers for building custom OAuth consent flows in Clerk.

Use this object together with the [useOAuthConsent()](/content/docs/nextjs/reference/hooks/use-oauth-consent/index.html) hook or the [<OAuthConsent />](/content/docs/nextjs/reference/components/authentication/oauth-consent/index.html) component when you need to render a custom consent page for an OAuth application.

## [Methods](/content/docs/nextjs/reference/types/oauth-application#methods/index.html)

### [`buildConsentActionUrl()`](/content/docs/nextjs/reference/types/oauth-application#build-consent-action-url/index.html)

Returns the URL to use as the `action` attribute of your consent form. Clerk includes the current session context automatically, including `_clerk_session_id` and, in development, the dev browser JWT.

```
function buildConsentActionUrl(params: { clientId: string }): string
```

#### [Parameters](/content/docs/nextjs/reference/types/oauth-application#parameters/index.html)
- Name `clientId`  
  Type `string`  
  Description  
  
  The OAuth `client_id` from the authorize request.

#### [Example](/content/docs/nextjs/reference/types/oauth-application#example/index.html)
```javascript
const actionUrl = clerk.oauthApplication.buildConsentActionUrl({
  clientId,
})
```

### [`getConsentInfo()`](/content/docs/nextjs/reference/types/oauth-application#get-consent-info/index.html)

Loads the consent metadata for a signed-in user and OAuth application. Returns a [OAuthConsentInfo](/content/docs/nextjs/reference/types/oauth-consent-info/index.html) object.

Use this method when you want to build your own consent UI without the [useOAuthConsent()](/content/docs/nextjs/reference/hooks/use-oauth-consent/index.html) hook.

```
function getConsentInfo(params: GetOAuthConsentInfoParams): Promise<OAuthConsentInfo>
```

#### [`GetOAuthConsentInfoParams`](/content/docs/nextjs/reference/types/oauth-application#get-o-auth-consent-info-params/index.html)
- Name `oauthClientId`  
  Type `string`  
  Description  
  
  The OAuth `client_id` from the authorize request.

- Name `scope?`  
  Type `string`  
  Description  
  
  A space-delimited scope string from the authorize request.

#### [Example](/content/docs/nextjs/reference/types/oauth-application#example-2/index.html)
```javascript
const consentInfo = await clerk.oauthApplication.getConsentInfo({
  oauthClientId: clientId,
  scope,
})
```
