---
metadata:
  - name: generator
    content: Diplodoc Platform v5.44.0
alternate:
  - https://yandex.com/dev/id/doc/en/suggest/script-sdk-suggest-token.md
  - https://yandex.com/dev/id/doc/ru/suggest/script-sdk-suggest-token.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/id/doc/en/llms.txt

# Set up the sdk-suggest-token.js script for the callback page

Enable one of the sdk-suggest-token.js script versions on the page that will accept an OAuth token:

{% list tabs %}

- Version with polyfills (recommended)

   ```html
   <head>
      
   </head>
   ```

   See also: 
   * [Polyfills](https://en.wikipedia.org/wiki/Polyfill_(programming))

- Basic version

   ```html
   <head>
      
   </head>
   ```

{% endlist %}


## Syntax and parameters {#sdk-suggest-token-syntax}

```javascript
YaSendSuggestToken(origin, extraData)
```

A call example for the login widget or button:

```javascript
YaSendSuggestToken(
   'https://examplesite.com',
   {
      flag: true
   }
)
```

See also [Example of usage on an HTML page](#example)

Parameter descriptions:




#|
|| **Parameter** | **Description** ||
|| `origin`	| "Origin" of the page with a login button or widget to which a `postMessage` with a token is sent. The parameter value must always be filled in and can't contain the `*` character. ||
|| `extraData` | Extra data sent to the page with a login button. Must be a valid JSON object. ||
|#


## Return value {#sdk-suggest-token-return-value}

Doesn't return anything.


## Example of usage on an HTML page {#example}

Use the following code to set up a callback page that will receive the token:

```html
<!doctype html>
<html lang="ru">

<head>
   <meta charSet="utf-8" />
   <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, shrink-to-fit=no, viewport-fit=cover'>
   <meta http-equiv='X-UA-Compatible' content='ie=edge'>
   
   
</head>

<body>
   
</body>

</html>
```
