Contact TLCC

Add instant messaging to Domino apps with Sametime Links

Date tip published:04/21/2003
Description:The Sametime Links toolkit was introduced with Version 3.0 of Sametime. This toolkit makes it easy to add instant messaging/collaboration to any web application.


To learn more about web applications and JavaScript use the following links:

R5 Beginner JavaScript for Domino
Beginner R5 Domino Web Application Development



Many Domino shops use Sametime for internal instant messaging. However, integrating instant messaging into other web applications can be challenging. The way to integrate Sametime into a web application has traditionally been by writing a Java applet. This requires Java programming skills. Another down side is that the jar files needed by the applet can be approximately 450 KB.

Version 3.0 of Sametime introduced the Sametime Links toolkit. This is an easy to use way to add instant messaging/collaboration to a web application by just using html and JavaScript. The applet needed for Sametime Links is only 20-35 KB resulting in much less network overhead. To add a Sametime link to a Domino form requires three steps:

  1. Add code to the HTML Head Content section:

    "<LINK REL=STYLESHEET HREF=\"http://yourserver.com/sametime/stlinks/stlinks.css\" TYPE=\"text/css\"> <script src=\"http://yourserver.com/sametime/stlinks/stlinks.js\"></script> <script>setSTLinksURL(\"http://yourserver.com/sametime/stlinks\");</script>"

    Change the "yourserver.com" to be the name of your Sametime server in the above code example.
  2. Add code to place the "hidden" Sametime Links applet on the web page. The code below will assume an anonymous user. Mark this as pass-thru HTML.

    <script>writeSTLinksApplet("","",false); </script>

    In the line above the first parameter is the username ("" is for "Anonymous"), the second parameter is the password ("" for the Anonymous user) and the final parameter signifies that password authentication will be used. If this third parameter is true then token authentication is used and the user is not prompted to login again if they already have logged in to the Domino (or WebSphere) server.

    Note: Anonymous login must be enabled on your Sametime server to allow users to login without a valid username or password.
  3. Create links using the Sametime Links API. In the code below if John is active (logged into Sametime) the link will be active. Mark this as pass-thru HTML:

    <Script>writeSametimeLink("John Smith/Your Co", "Click here to IM John!")</Script>

    The first parameter is the username for the user who will get the instant message when the link is clicked. The second parameter is the actual text that displays on the web page. Using the code above produces the following web page (form):

    If John was not logged into Sametime then the link would not be active. If John had marked that he was away from his office or did not want to be disturbed then the link would be active but the icon next to the message would change. Below is an example of how the link looks like when John is not logged into Sametime.


More information on Sametime Links can be found in the Sametime Links documentation installed on your Sametime 3.0 server. This documentation is in the domino\html\sametime\tookits\st30linkstk\doc directory. You can also use the following URL to read the documentation on the Lotus web site:
Sametime Links can do much more than simple one-to-one instant messaging. Place awareness can be added to a web application to show what users are visiting a particular web page or group of web pages. Multiple person chats can be setup and tools like screen sharing and white boarding can be added to the application.

The really cool part about Sametime Links is that it is very customizable. The best documentation on customizing Sametime Links is written by Carl Tyler of Instant Technologies, an IBM/Lotus business partner. Carl has written a guide to customizing Sametime Links including the dialog boxes that appear. These dialog boxes are all html files and are easy to customize. Carl's tutorial shows what each html file does and how to customize Sametime Links using simple HTML, cascading style sheets and JavaScript. This tutorial can be downloaded at: