# Custom User Agent

### <mark style="color:green;">What is User Agent?</mark>

A user-agent is like a digital ID card that your app carries with it when it talks to your website. It tells the website what kind of device your customers are using.&#x20;

If you want to identify that request is coming from your mobile app then you can set custom user-agent such as `twinr-app.` Now, this user-agent string will be passed to each request to your website and you can easily identify that request is coming from the mobile app.

User-Agent String is contained in https headers with other info.

A sample user-agent string for an iPhone using the Safari browser might look like this:

`Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1`

This string contains several pieces of information about the device and browser:

* **"Mozilla/5.0"** is a standard prefix for user-agent strings that indicates the browser is compatible with the HTTP protocol used by the web.
* **"iPhone; CPU iPhone OS 14\_4 like Mac OS X"** indicates that the device is an iPhone running the 14.4 version of the iPhone operating system.
* **"AppleWebKit/605.1.15"** indicates that the browser is using the WebKit rendering engine, which is developed by Apple and used in Safari and other browsers.
* **"Version/14.0.3"** indicates the version of the Safari browser.
* **"Mobile/15E148"** indicates the mobile version of the browser
* **"Safari/604.1"** indicates the browser type as Safari version 604.1

### <mark style="color:green;">How to setup Custom User Agent?</mark>

<figure><img src="/files/V1UX3mr8v7JbuHzqTRQL" alt=""><figcaption></figcaption></figure>

**1.)** Go to Add-ons -> Extensions -> Custom User Agent & Enable it.

<mark style="color:red;">**NOTE:**</mark> <mark style="color:red;">Please create a new version of the App e.x. 1.0.2, if the current version does not support this feature. If the previous version is live on the stores, then request a new build and submit this new version to the stores.</mark>

**2.)** Enter the User Agent String in the field. You can define separate agents for Android and iOS.

**3.)** Enable the "Attach" option if you want to concatenate with the existing user-agent string. It will look like below.

`Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1 Flow_app_agent`

**4.)** Save as a draft.

### <mark style="color:green;">When should I use Custom User Agent?</mark>

* When you want to manipulate whole app with different UI, JS for different devices.
* If you want to use social media login feature from your website then you must setup Custom User-Agent to make it working.

### <mark style="color:green;">Common Questions</mark>

<details>

<summary><strong>What kind of User-Agent string I can use?</strong></summary>

You can use any kind of string for the User-Agent. Try to avoind any special characters.

</details>


---

# 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://help.twinr.dev/extensions/custom-user-agent.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.
