Sr. Developer Advocate
Have you ever wanted to send an email, start a phone call, or open another program from your Appsmith app? Appsmith apps run in your browser, using the https protocol to direct the user to different parts of your app. But there are other protocols we can use add functionality and integrate with programs outside of the browser.
So what is a protocol, anyway? In general terms, a protocol refers to a set of rules and conventions that govern how data is exchanged between devices or systems in a structured and standardized manner. It defines the format, sequence, error control, and data validation rules for communication. They can be categorized as follows:
|Determine data transmission across networks.
|TCP/IP, UDP, HTTP, HTTPS
|Control specific data exchange or services.
|SMTP, FTP, SSH, mailto, deeplinks
|Define data structure, serialization, and interpretation.
|JSON, XML, Protocol Buffers
A Uniform Resource Identifier (URI) is a string of characters that identifies a particular resource, either on the internet or within a specific context, in a standardized format. It serves as a compact representation used to locate or identify resources, typically on the web.
A deep link is a hyperlink or URL that directs users to a specific page, section, or content within a mobile app or a web application, bypassing the app's or website's main landing page. It enables users to access specific parts of an app directly, enhancing user experience and streamlining navigation within the application.
For instance, you can use the
slack:// scheme to construct a deeplink to a specific channel, which will open in the user's installed Slack app instead of the browser.
Or you can create a new note in Obsidian:
The first option is to use a Button Widget, or any widget's onClick event or other trigger. In the action selector, choose NavigateTo, then choose URL and enter the deeplink or other URI.
NOTE: Be sure to choose NEW WINDOW, so the user can keep the Appsmith app open while handing off to the other program.
The last option is from an HTML tag, which can be done using an iframe. Although the Text Widget will display achor tags and a few other HTML tags, the links are sanitized and won't open other protocols. But if you put that same anchor, button, or other tag in an iframe, now the other protocols will work.
Same anchor tag in a Text Widget, and Iframe Widget. The links with other protocols only work from the iframe.
Deeplinks and other protocols are a great way to add new features and functionality to your Appsmith apps. By using mailto links, and schemes for programs like Slack and Obsidian, you can build apps that interact with other programs on the user's device.