> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.id.me/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.id.me/_mcp/server.

# JavaScript

> Learn more about integrating using JavaScript

Version 1.0

Released October 13, 2021

\
\


View on GitHub

This is JavaScript sample code to make API requests with ID.me using OAuth 2.0

> **Note**
>
> You will need an [ID.me developer account](https://api.id.me/en/registration/new) to complete this process

## Prerequisites

You must include `jquery` and ID.me's `javascript` dependencies in your application

You must have `node` installed

## Dependencies

**jQuery**

```javascript
<script type="text/javascript" src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
```

**ID.me**

```javascript
<script src="https://s3.amazonaws.com/idme/developer/idme-buttons-2.0.1/assets/js/idme-modal.min.js" type="text/javascript"></script>
```

## Installation

Log in to your ID.me [developer account](https://api.id.me/en/registration/new) and follow the prompts to use the button generator

Set your client configuration settings in `idme.js` with the values provided within your developer account

```javascript
data-scope             = 'SCOPE' 
// possible scope values: "military", "student", "responder", "government", "teacher"

data-client-id         = 'YOUR_CLIENT_ID'
data-redirect          = `YOUR_REDIRECT_URI`
data-response          = `RESPONSE`
// possible values: "code", "token"

data-op                = `OP`
// possible values: "signin", "signup"

data-text              = `OFFER_DESCRIPTION_TEXT`
data-display           = 'DISPLAY'
// possible values: "popup", "link"

data-show-verify       = 'SHOW'
// possible values: "true", "false"
```

Run the following within the directory of the sample code:

```bash
npm install -g serve
serve -p 3000
```

View the app at [http://localhost:3000](http://localhost:3000)