# Website Member Integration Guide

Website members linkage method (registering web users to Swing2App service).

It is a task to register by matching the device to the Swing2App DB.

We request JavaScript insertion for member linkage.

Please insert the following sentence in the common header (so that the script fits on all screens).

The user ID below refers to your web users.

### - Code inserted when logged in

{% code lineNumbers="true" %}

```html
<script src="https://pcdn2.swing2app.co.kr/swing_public_src/v3/2022_06_17_001/js/swing_app_on_web.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
    swingWebViewPlugin.app.login.doAppLogin("test_account","test_name");
});
</script>
```

{% endcode %}

ex:) User ID: test\_account, Username: test\_name

{% code lineNumbers="true" %}

```html
<script src="https://pcdn2.swing2app.co.kr/swing_public_src/v3/2022_06_17_001/js/swing_app_on_web.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
    swingWebViewPlugin.app.login.doAppLogin("test_account","test_name");
});
</script>
```

{% endcode %}

### - Code inserted when logged out or not logged in

{% code lineNumbers="true" %}

```html
<script src="https://pcdn2.swing2app.co.kr/swing_public_src/v3/2022_06_17_001/js/swing_app_on_web.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
    swingWebViewPlugin.app.login.doAppLogout();
});
</script>
```

{% endcode %}

{% hint style="info" %}
js file insertion tips

(1) You only need to insert the js file once.

(2) It is recommended to insert it into the common header and footer of the website.
{% endhint %}

After completing the member linkage, you can send the push by the website itself using the push-sending API.

[\[Push Sending API Guide\]](/developer/server-side-api.md)


---

# 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://documentation.swing2app.com/developer/webview/user-integration.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.
