How to create a ChatGPT plugin and track its usage in 5 minutes with PluginLab
Although ChatGPT plugins are still in limited alpha, more and more developers have access to them.
Whether you’re an approved developer already or just planning to create plugins in the future, in this article, you will learn how to make your first ChatGPT plugin and track its usage in 5 minutes.
What are we going to do?
- Deploy our first CoffeeShop Plugin using PluginLab
- Install it on ChatGPT
- Track ChatGPT events
We are going to build a simple Coffee Shop plugin that consists of three features:
- Ask ChatGPT to list some coffee-based drinks flavors
- Ask for details about one or more drinks (such as calories and temperature…)
Before we start
What is PluginLab?
First, what is PluginLab? The answer is simple: it’s a tool that will make you win a lot of time.
PluginLab offers a web dashboard to create and manage your plugin in a few clicks.
Is it required to use PluginLab?
Although PluginLab is not required, this tool will help you create and validate your manifest file, host your plugin manifest + spec file, version your OpenAPI spec, track events from your users, and more.
Since it’s the easiest way to get started with plugins, we’ll use it in this tutorial.
Let’s get started
- Create a free account on www.pluginlab.ai in one click
2. Choose “Start with an example.”
3. Go to “Plugin settings.”
At this step, you already have an example Coffee Shop plugin created for you.
You can watch the video to get a quick tour of the application and understand what’s going on. But in this article, we’ll go straight to the point and head to the “Plugin settings” tab.
4. Copy the preview domain URL and open ChatGPT
On this page, you can see that PluginLab already configured a plugin manifest with all the required information needed to run your plugin.
PluginLab also generated a custom preview domain that you can use to install your plugin on ChatGPT.
Simply copy the preview domain URL and open ChatGPT on a new tab.
Note: if you open one of these URLs, you will see the following message:
{“code”:”IP_NOT_ALLOWED”,”message”:”IP is not allowed to access this plugin.”}
This is normal because, by default, PluginLab only authorizes access to the ChatGPT server's IP addresses.
5. Install your plugin on ChatGPT
6. Ask ChatGPT to list and purchase some coffees.
Once your plugin is installed, here are some prompts you can use:
- Hey, can you list me some coffee-based drinks?
- Can you give me the detailed calories of <coffee-name>?
- Hey, can I purchase <number> <coffee-name>?
7. Enjoy your usage metrics
Without any additional setup, you can now see all the requests made by ChatGPT to your plugin on your event panel.
Since we never know how ChatGPT will use your plugin, this is very helpful for tracking errors and unexpected parameters, especially when other developers are testing your plugin.
I hope this tutorial has been helpful :)
If you want to learn more about ChatGPT plugins and how PluginLab integrates with them, I suggest you watch this video: