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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@timbenniks/contentstack-endpoints

v3.0.2

Published

A utility package to get Contentstack API endpoints based on cloud and region

Readme

@timbenniks/contentstack-endpoints

Get the correct Contentstack API endpoints for any region and cloud provider.

Installation

npm install @timbenniks/contentstack-endpoints

Usage

import { getContentstackEndpoints } from "@timbenniks/contentstack-endpoints";

// Pass a region string — defaults to "na"
const endpoints = getContentstackEndpoints("eu");

console.log(endpoints.contentDelivery); // https://eu-cdn.contentstack.com
console.log(endpoints.contentManagement); // https://eu-api.contentstack.com

// Works with environment variables
const endpoints = getContentstackEndpoints(process.env.CONTENTSTACK_REGION || "na");

// Remove https:// prefix
const endpoints = getContentstackEndpoints("eu", true);
console.log(endpoints.contentDelivery); // eu-cdn.contentstack.com

Returns an empty object for invalid inputs (no errors thrown):

getContentstackEndpoints("invalid"); // {}

With Contentstack SDK

import Contentstack from "@contentstack/delivery-sdk";
import { getContentstackEndpoints } from "@timbenniks/contentstack-endpoints";

const endpoints = getContentstackEndpoints("eu");

const stack = Contentstack.stack({
  apiKey: "your-api-key",
  deliveryToken: "your-token",
  environment: "production",
  region: endpoints.contentDelivery,
});

Region enum (optional)

If you need explicit type safety or enum validation:

import { getContentstackEndpoints, getRegionForString } from "@timbenniks/contentstack-endpoints";

const region = getRegionForString(process.env.CONTENTSTACK_REGION as string);
const endpoints = getContentstackEndpoints(region);

Supported Regions

All official Contentstack regions and aliases (case-insensitive):

| Region | Aliases | | ----------------------- | -------------------------------------- | | AWS North America | "na", "us", "aws-na", "aws_na" | | AWS Europe | "eu", "aws-eu", "aws_eu" | | AWS Australia | "au", "aws-au", "aws_au" | | Azure North America | "azure-na", "azure_na" | | Azure Europe | "azure-eu", "azure_eu" | | GCP North America | "gcp-na", "gcp_na" | | GCP Europe | "gcp-eu", "gcp_eu" |

Available Endpoints

| Property | Description | | ----------------------- | --------------------------- | | application | Contentstack Web App URL | | assets | Assets API | | auth | Authentication API | | automate | Automate API | | brandKit | Brand Kit API | | composableStudio | Composable Studio API | | contentDelivery | Content Delivery API (CDN) | | contentManagement | Content Management API | | developerHub | Developer Hub API | | genAI | GenAI & Knowledge Vault API | | graphqlDelivery | GraphQL API | | graphqlPreview | GraphQL Preview API | | images | Image Delivery API | | launch | Launch API | | personalizeEdge | Personalize Edge API | | personalizeManagement | Personalize Management API | | preview | REST Preview API |

Deprecated aliases (still work):

| Alias | Use instead | | --------------- | ----------------------- | | graphql | graphqlDelivery | | imageDelivery | images | | brandKitGenAI | genAI | | personalize | personalizeManagement |

API

getContentstackEndpoints(region?, omitHttps?)

Returns an object with endpoint URLs for the given region.

  • region — Region string or Region enum (default: "na")
  • omitHttps — Strip https:// prefix (default: false)

getRegionForString(regionString)

Converts a region string to a Region enum. Returns undefined for invalid input.

Data Source

Endpoints are auto-generated from Contentstack's official regions configuration.

npm run generate-endpoints

License

MIT