npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

appurl

v1.0.6

Published

Official AppURL API Library

Downloads

6

Readme

Official AppURL API for NodeJS

About

This module provides easy access to the AppURL API for NodeJS.

The AppURL API requires an API key / access token. To get your access token, visit https://docs.appurl.com/api/get-access-token.

For more information on the API structure, check out the AppURL API Docs.

Installation

NPM

npm install appurl

YARN

yarn add appurl

Usage:

Remember, this library uses an API key provided by AppURL. To get your access token check out docs.appurl.com/api/get-access-token.

If you would like more info on the underlying API check out docs.appurl.com.

Example:

import { AppUrlClient } from 'appurl';

const appurl = AppUrlClient('TOKEN');

 async function getShortedUrl(url) {
  let result;
  try {
    result = await appurl.shorten(url);
  } catch (err) {
    throw err;
  }

  return result;
}

getShortenedUrl('https://google.com');

Additional Features

Because the AppURL API is protected by an API key which you are responsible for we are able to offer more access.

Image Upload

The AppURL API and this Module accept image uploads. This allows for very specific control of how your link preview looks when shared across a variety of mobile devices and apps.

To use the image upload you must for BASE64 encode your image, then pass that string as the second argument of your shorten function call. Here is an example.

Example:

import { AppUrlClient } from 'appurl';

const appurl = AppUrlClient('TOKEN');
const base64EncodedImage = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=';

 async function getShortedUrl(url, base64EncodedImage) {
  let result;
  try {
    result = await appurl.shorten(url, base64EncodedImage);
  } catch (err) {
    throw err;
  }

  return result;
}

getShortenedUrl('https://google.com', base64EncodedImage);

The code above will upload the image at set it as your preview image. This is extremely handy for sharing.

Optional Properties

Optional properties are one more way you have complete control over your AppURL. The third optional argument of the shorten function is an object containing a very specific list of settings for your AppURL allowing you to control every aspect of it's functionality.

Properties

    'appName'
    'fallbackUrl'
    'iosIphoneAppUrl'
    'iosIphoneFallbackUrl'
    'iosIpadFallbackUrl'
    'iosIpadAppUrl'
    'androidAppPackage'
    'androidAppScheme'
    'androidFallbackUrl'
    'windowsPhoneAppUrl'
    'windowsPhoneFallbackUrl'
    'blackberryFallbackUrl'
    'clickSendUsername'
    'clickSendApiKey'
    'googleAnalyticId'
    'ogDescription'
    'ogImageUrl'

This example would upload the custom preview image and set the redirect landing page title to "My App" and the share preview description to "This is my amazing app!".

Example:

import { AppUrlClient } from 'appurl';

const appurl = AppUrlClient('TOKEN');
const base64EncodedImage = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=';

 async function getShortedUrl(url, base64EncodedImage, props) {
  let result;
  try {
    result = await appurl.shorten(url, base64EncodedImage);
  } catch (err) {
    throw err;
  }

  return result;
}

getShortenedUrl('https://google.com', base64EncodedImage, {
  appName: 'My App',
  ogDescription: 'This is my amazing app!'
});

Contact us

We are proud of the products we are making! If you have any questions please don't hesitate to reach out to AppURL Support.