Skip to main content
Use TinyURL to shorten long links and keep messages clean and readable.

Before you begin

1

Create a TinyURL account

Sign up with TinyURL.
2

Generate an API token

In TinyURL, open AccountAPI and create a token with permission to create TinyURL links.
3

Save the token

Keep the API token handy for the extension settings.

Extension settings

1

Open your CometChat app

Login to CometChat and select your app.
2

Enable TinyURL

Go to Chat & Messaging —> Features, under Extentions and enable TinyURL.
3

Add credentials

Open the settings and enter the TinyURL API Token.
4

Configure BYO domain (optional)

If you have a paid plan, add your custom domain or subdomain. The default is tinyurl.com.
5

Save settings

Save your configuration to activate the extension.
If you don’t plan on using a custom domain, keep tinyurl.com as the default value.

Choose Your Integration Method

Choose the integration method that best suits your needs:

UI Kit Builder

  • Enable it in both Dashboard and UI Kit Builder settings, then you can use the TinyURL extension in your custom chat experience.

Widget Builder

  • Enable it in both Dashboard and Widget Builder settings, then you can use the TinyURL extension in your custom chat widget.

UI Kits

  • Enable it in the Dashboard settings, then you can use the TinyURL extension in your custom chat experience built with our UI Kits.

SDK

  • Enable it in the Dashboard settings, then you can use the TinyURL extension in your custom chat experience built with our SDK.

Code

This extension uses the callExtension method provided by CometChat SDK. You can call the extension as follows:
CometChat.callExtension("url-shortener-tinyurl", "POST", "v1/shorten", {
  text: "Your message with URL https://yourdomain.com/very/very/long/url",
})
  .then((response) => {
    // minifiedText in response
  })
  .catch((error) => {
    // Error occured
  });