@abeai/node-short-url

1.1.0 • Public • Published

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.key to override.

Readme

Keywords

none

Package Sidebar

Install

npm i @abeai/node-short-url

Weekly Downloads

7

Version

1.1.0

License

none

Unpacked Size

13.6 kB

Total Files

16

Last publish

Collaborators

  • abe-ai
  • abeai-sam