@abeai/node-short-url

    1.0.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.

    Keywords

    none

    Install

    npm i @abeai/node-short-url

    DownloadsWeekly Downloads

    69

    Version

    1.0.0

    License

    none

    Unpacked Size

    13.2 kB

    Total Files

    14

    Last publish

    Collaborators

    • avatar
    • avatar