# Web

Please do the following to integrate your web application with devtodev:

1\. Add the application to the Space using the wizard for adding applications.

2\. To integrate SDK, add the following line to the tag of your page:

```javascript
<script type="text/javascript" src="https://cdn.devtodev.com/sdk/web/v2/devtodevsdk.js">
</script>
```

3\. Init the SDK.

## Initialization

In order for SDK for WEB to start working, it is necessary to perform initialization right after the page is loaded and you have a basic user identifier at your disposal.

```javascript
window.devtodev.initialize("App ID", config);
```

* You can find the **App ID** in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
* **`config`** - is an object that is used for specifying additional properties during initialization.

**`Config`**

<table data-header-hidden><thead><tr><th width="273.45508982035926">Parameter</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td></tr><tr><td><strong><code>userId</code></strong></td><td>string</td><td><p>Unique user identifier. For example, user’s ID in a social network, or a unique account name used for user identification on your server. If at the time of initialization this identifier is not yet available, specify the identifier later using </p><p> the <strong><code>setUserId</code></strong> method.</p></td></tr><tr><td><strong><code>currentLevel</code></strong></td><td>integer</td><td>The player level at the moment of devtodev SDK initialization. It’s optional but we recommend using it for improving data accuracy.</td></tr><tr><td><strong><code>trackingAvailability</code></strong></td><td>boolean</td><td>The property allows or disallows devtodev tracking of the user. By default, it is set to <em><strong><code>true</code></strong></em>. SDK stores the previously assigned value. Pass false if the user opted out of tracking in line with GDPR.</td></tr><tr><td><strong><code>logLevel</code></strong></td><td>string</td><td>The level of logging the SDK activity. The "<em><strong><code>No</code></strong></em>" value is used by default. For troubleshooting during integration, it is recommended to set it to "<em><strong><code>Debug</code></strong></em>", and either switch it "<em><strong><code>No</code></strong></em>" or use it only for error handling "<em><strong><code>Error</code></strong></em>" in the release version.</td></tr></tbody></table>

Example:

```javascript
var config = {};
config.userId = "Unique user identifier";
config.currentLevel = 2;
config.trackingAvailability = true;
config.LogLevel = "Error";
window.devtodev.initialize("App ID", config);
```


---

# 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.devtodev.com/in-developing/integration-of-sdk/sdk-integration/web.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.
