You can test out this extension right away!
-
Go to your Cloud Firestore dashboard in the Firebase console.
-
If it doesn't exist already, create a collection called
${param:COLLECTION_PATH}
. -
Create a document with a field named
${param:URL_FIELD_NAME}
and make its value a URL such ashttps://github.com/firebase/firebase-tools
. -
In a few seconds, you'll see a new field called
${param:SHORT_URL_FIELD_NAME}
pop up in the same document you just created; it will contain the shortened URL.
This extension listens to the Cloud Firestore collection ${param:COLLECTION_PATH}
. If you add a URL to the field ${param:URL_FIELD_NAME}
in any document within that collection, this extension:
- Shortens the URL.
- Saves the shortened URL in the
${param:SHORT_URL_FIELD_NAME}
field of the same document like so:
{
${param:URL_FIELD_NAME}: 'https://my.super.long-link.example.com/api/user/profile/-jEHitne10395-k3593085',
${param:SHORT_URL_FIELD_NAME}: 'https://bit.ly/EKDdza',
}
If the original URL in a document is updated, then the shortened URL will be automatically updated, too.
As a best practice, you can monitor the activity of your installed extension, including checks on its health, usage, and logs.