1.1.0 • Published 4 years ago
@abeai/node-short-url v1.1.0
node-short-url
URL shortener for usage with node.js applications. Supports multiple backends.
Interface
Promise shorten(url[, opts])
Shorten a URL using the requested backend.
opts
- backendType - String- Provide a backend type to use or override- process.env.NODE_SHORT_URL_BACKEND.
- backendOptions - Object- Backend specific options to use for short url generation.
Environment Variables
- NODE_SHORT_URL_BACKEND
		- Define the short url backend to use. Can override with opts.backendType.
Backends
Firebase
https://firebase.google.com/docs/reference/dynamic-links/link-shortener
Create dynamic links via Firebase's API. Options are provided in the dynamicLinkInfo JSON format.
Default Options
- suffix.option
		- Defaults to SHORT.
Required Environment Variables
- NODE_SHORT_URL_FIREBASE_DOMAIN
- NODE_SHORT_URL_FIREBASE_API_KEY
		- Can pass backendOptions.keyto override.