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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@shi-corp/sdk-url-shortener

v1.0.1

Published

SDK client used to interface with the URL Shortener application.

Readme

URL Shortener - TypeScript SDK

This SDK provides a convenient TypeScript client for interacting with the SHI URL Shortener service. It is automatically generated from the OpenAPI specification located at Url-Shortener.json using Kiota.

All typing data is included in the package.

Installation

Install the SDK using npm:

npm install @shi-corp/sdk-url-shortener

Usage

Here's a basic example of how to use the SDK:

import { DefaultAzureCredential } from '@azure/identity'
import { urlShortenerClientFactory } from '@shi-corp/sdk-url-shortener';

/** Authentication session used to authenticate to URL Shortener. */
const credential = new DefaultAzureCredential();

/** Base URL for your URL Shortener instance. Protocol specifier (`http`/`https`) is required, even for localhost. */
const baseUrl = new URL('https://url-shortener.example.com');

/**
 * Configured client for URL Shortener that can make authenticated web requests against backend.
 *
 * The third param, the scope is the `Application ID` of the `End User Login` app registration.
 */
const urlShortenerClient = urlShortenerClientFactory(credential, baseUrl, ['b9689d4e-0036-4f2f-8430-07adedb9ae7c/.default']);

/** List of available redirect entries. */
const results = await urlShortenerClient.api.redirect.get();

// Check if list is not empty
if (results?.length > 0) {
    // Do something
}

Advanced Usage

You can optionally configure the SDK client with a custom base URL, including support for it being nested deep in a L7 load balancer:

/** Custom host and endpoint base to as an example for something behind a layer 7 load balancer, E.g. Azure App Gateway or Azure API Gateway. If in debug mode, run against localhost. */
const customBaseUrl = debugMode ? new URL('http://localhost:3004') : new URL('https://custom-host.example.com/Ballance/Instance1/');

/** Configured instance of the URL Shortener client. */
const customConfiguredClient = urlShortenerClientFactory(credential, customBaseUrl);

and/or scope (permission) list:

/**
 * `.default` and explicit permissions can't exist in the same custom scope list at the same time, Entra ID doesn't support this.
 *
 * If not providing the `.default` scope, you can have any number of scopes (permissions) listed in different array indexes.
 */
const customScopes = ['your-custom-scope/something.read.all', 'your-custom-scope/everything.readwrite.all'];

// Initialize the SDK client with custom configuration.
const customConfiguredClient = urlShortenerClientFactory(credential, void 0, customScopes);

Project Structure

  • bin/: Compiled JavaScript files and type definitions.
  • sdk/: Source TypeScript files generated by Kiota.
    • api/: API endpoint definitions.
    • models/: Data models used by the SDK.

Development

Prerequisites

Generating the SDK

To regenerate the SDK from the OpenAPI specification, run:

npm run generate:Sdk

Building the SDK

To build the SDK for production, run:

npm run build:Prod

License

This SDK is licensed under the MIT License.

Support

For issues or feature requests, please visit the GitHub Issues page.

For more information, visit the official documentation.