You can test out this extension right away:
-
Go to the Cloud Firestore tab.
-
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://yourapp.page.link/WXYZ',
}
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.
If the https://yourapp.page.link/WXYZ
links are still too long for you, or if
you want short links with your own branding, you can use your own domain for
your Dynamic Links. See Set up a custom domain for Dynamic Links.