You can build a Google Chat app using Google Apps Script, your own technical stack, or AppSheet.
To build a basic Chat app, see the following quickstarts:
- Build a Chat app with Google Apps Script
- Build a Chat app with Google Cloud Functions
To build a Chat app without needing to write code, you can use AppSheet. For more information, see AppSheet's Chat apps documentation.
Build interactive Google Chat apps
Most Google Chat apps let users message and interact with the app directly. Interactive Google Chat apps can do any of the following:
- Respond to slash commands with a text message or card message.
- Open a dialog to help users complete multi-step processes, like filling in form data.
- Preview links by attaching cards with helpful information that let users take action directly from the conversation.
To interact with users, your Chat app must be able to receive and respond to interaction events. To build an interactive Chat app, see Receive and respond to Google Chat app interaction events.
App access to user data
In order to operate in a useful way, when an app is invoked, it needs to know who is invoking it, in what context, and how to address the invoker. To access data beyond this basic identity data, the app must be granted access through authentication.
- By default, apps can only read the basic identity of users that invoke them or users being @mentioned in the same message that invokes the app. This information includes the user's display name, user ID, email address, and avatar image.
- For apps with link preview, the app can read URLs added to the message that match the app's configured URL patterns.
- If an app needs to access other data to provide enhanced functionality to users, set up authentication so it can access that data. If accessing user data, the app prompts the user to ask for access, and the user must grant it. To learn more, see Connect a Chat app with other services & tools.
Independence from users
Chat apps aren't associated with any particular user: anyone in your domain can add an app to a space or remove it. Once the app is added to a space, anyone in your domain can @mention it. Apps aren't accessible by external users who aren't in your domain.
Some use cases for apps
Adding apps to a conversational platform like Chat lets people ask questions, and issue commands, without changing context. On its backend, an app can access other systems, acting as an intermediary to those systems.
This ability to provide access to a wide range of resources and tools, while maintaining a unified cognitive experience, can provide an excellent framework for many types of applications, including the following:
- Workflow management
- Setup and configuration
- Order generation
- Data collection
Some examples of things you might ask an app to do from within the Chat space include the following:
- Look up information — An app can retrieve information based on structured or free text queries entered by the user.
- File tickets — An app can generate incident reports or other artifacts, using information provided by the user.
- Coordinate efforts — An app can enhance the way that team members interact with each other, such as providing "team memory" or scheduling resources.
Google Chat API
The Chat API provides a number of ways that you can integrate your apps into Chat spaces and DMs, but does not provide or dictate any particular way to implement the app logic. You can create a simple command-driven app or use any kind of language processing and AI services or modules that you like, and you can do this on a variety of platforms, including the following:
- Apps Script
- Google Cloud
- Cloud or an on-premises HTTP server
For more information, see App implementation architectures.
When you configure an app in Chat, it must provide an identity consisting of the following:
- The app name
- An avatar image for the app
- Identity of the app developer
Apps should also provide a help command or the equivalent to help users get started using the app.
Apps in direct messages (DM)
You can configure an app so that it responds to direct messages. This provides a one-to-one conversational interface that involves a single user.
Apps in Chat spaces
You can add an app to a Chat space, so that it can respond to specific content that appears in the space. For example, you can specify that any message that begins with "@altostrat" is passed to the altostrat app and the response appears in the chat space. The following sequence diagram summarizes the app behavior:
Chat communicates with your app with an endpoint, which can be one of the following types:
- HTTP (web service) endpoints can accommodate various styles of interaction.
- Cloud Pub/Sub endpoints let your app subscribe to a topic that relays messages from Chat, even if the implementation is behind a firewall.
For more information about the different ways that you can connect Chat with your app, see Endpoint types.
Chatbots in Chat
Chatbots, or "bots" for short, are computer programs that interact with people in a way that mimics human interaction to some degree. The interaction can vary in complexity from simple keyword-driven queries to elaborate conversational systems using natural language processing and AI techniques. This conversational form of human-computer interaction can act as a framework for many types of useful applications.
Early chatbots included academic curiosities like Eliza (1964) and Julia (1994), but now bots are at work all over the internet in customer support, as virtual assistants like Google Assistant, and in many other roles.
A Google Chat app can be called a chatbot, and including "bot" in your app name is a fun way to represent your service. Because Chat apps are fully functional web applications and services, we encourage you to think of Chat apps as more than "just bots".