Add-to-app link
Last updated November 22, 2026
Put a button on your website, in an email or in your client area that opens Cosmos Client with the profile link already filled in. The user reviews it and taps Add — nothing is added or connected without them.
Format
cosmosclient://import_profile?url=<profile link>&name=<profile name>
url— the profile link, percent-encoded (encodeURIComponentin JavaScript,urllib.parse.quote(link, safe='')in Python).- Only
https://profile links are accepted; the whole link must be under 2 KB. name— optional profile name, percent-encoded the same way; any language and emoji are fine (UTF-8). It fills the Name field; the user can change it. Withoutnamethe field is empty and the user names the profile. Names longer than 40 characters are cut; line breaks become spaces.
Example:
https://example.com/sub/abc123
cosmosclient://import_profile?url=https%3A%2F%2Fexample.com%2Fsub%2Fabc123
With a name (Мой VPN 🚀):
cosmosclient://import_profile?url=https%3A%2F%2Fexample.com%2Fsub%2Fabc123&name=%D0%9C%D0%BE%D0%B9%20VPN%20%F0%9F%9A%80
Building it:
const link = 'cosmosclient://import_profile?url=' + encodeURIComponent(profileLink)
+ '&name=' + encodeURIComponent(profileName);
from urllib.parse import quote
link = f"cosmosclient://import_profile?url={quote(profile_link, safe='')}&name={quote(profile_name, safe='')}"
If url is the only parameter, an unencoded link also works, but encode it to be safe. With name, url must be encoded: an unencoded link swallows everything after it.
What the user sees
- The app is installed — it opens on the New profile sheet with your link (and name, if given) filled in. If the same profile is already added, the app says so and adds nothing.
- The app isn’t installed — the system can’t open the link. Handling this is up to you: put a download link next to the button.
Telegram bots
Telegram buttons accept only https:// and tg:// links — a cosmosclient:// link can’t be a bot button. Use a page on your own domain that opens the cosmosclient:// link: your users already reach your domain to load their profile, so they will reach the page too.