Skip to main content
Use Bitly to shorten long URLs in messages and keep links clean and consistent.
Available via:
PlatformSetup
UI Kit Builder
Widget BuilderNot Supported
UI Kits
SDK
You need a Bitly Access Token and your Bitly Group GUID to enable this extension.

Before you begin

1

Create a Bitly account

Sign up at Bitly.
2

Generate an access token

In Bitly, open SettingsAPI and generate a new Access Token.
3

Get your Group GUID

Use Bitly’s Get Groups API with the token to fetch your Group GUID.

Extension settings

1

Enable Bitly in your CometChat app

Login to Dashboard, select your app, then go to Chat & Messaging —> Features, under Extentions and enable Bitly.
2

Add credentials

Open the extension settings and enter your Bitly Access Token and Group GUID.
3

Save settings

Save your configuration to activate the extension.

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 Bitly extension in your custom chat experience.

Widget Builder

  • Bitly is not supported in the Widget Builder. Please use one of the other integration methods.

UI Kits

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

SDK

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

Code

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