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

@adobe/spacecat-shared-launchdarkly-client

v1.1.1

Published

Shared modules of the Spacecat Services - LaunchDarkly Client

Readme

Spacecat Shared - LaunchDarkly Client

A lightweight LaunchDarkly client wrapper for checking feature flags in SpaceCat services.

Installation

npm install @adobe/spacecat-shared-launchdarkly-client

Usage

Basic Example

import { LaunchDarklyClient } from '@adobe/spacecat-shared-launchdarkly-client';

// Create client from Universal context
const ldClient = LaunchDarklyClient.createFrom(context);

// Check if flag is enabled for an IMS organization
const imsOrgId = '855422996904EB9F0A495F9B@AdobeOrg';
const isEnabled = await ldClient.isFlagEnabledForIMSOrg('FT_LLMO-2817', imsOrgId);

if (isEnabled) {
  // Feature is enabled for this organization
  console.log('Feature enabled');
} else {
  // Feature is disabled
  console.log('Feature disabled');
}

In a Request Handler

import { LaunchDarklyClient } from '@adobe/spacecat-shared-launchdarkly-client';

export default async function handler(request, context) {
  // Initialize client once (reuse across requests)
  const ldClient = LaunchDarklyClient.createFrom(context);
  
  // Get IMS org from request
  const imsOrgId = request.headers.get('x-ims-org-id');
  
  // Check feature flag
  const isEnabled = await ldClient.isFlagEnabledForIMSOrg(
    'FT_LLMO-2817',
    imsOrgId
  );
  
  if (isEnabled) {
    // New feature logic
    return executeNewFeature(request);
  }
  
  // Default/legacy logic
  return executeLegacyFeature(request);
}

With Custom User Key (Optional)

const ldClient = LaunchDarklyClient.createFrom(context);

// Provide a user key for tracking (defaults to 'anonymous')
const isEnabled = await ldClient.isFlagEnabledForIMSOrg(
  'FT_LLMO-2817',
  imsOrgId,
  'user-123' // optional user key for analytics
);

API

isFlagEnabledForIMSOrg(flagKey, imsOrgId, userKey?)

Checks if a feature flag is enabled for a specific IMS organization.

Parameters:

  • flagKey (string, required) - The LaunchDarkly feature flag key
  • imsOrgId (string, required) - The IMS organization ID (e.g., "855422996904EB9F0A495F9A@AdobeOrg")
  • userKey (string, optional) - User identifier for tracking (defaults to "anonymous")

Returns: Promise<boolean> - true if flag is enabled, false otherwise

Environment Variables

Set the following environment variable:

export LAUNCHDARKLY_SDK_KEY="sdk-your-server-side-key-here"

Note: Use a server-side SDK key (starts with sdk-), not a client-side ID.

LaunchDarkly Configuration

In your LaunchDarkly dashboard, configure targeting rules using:

  • Attribute: organization identityProviderId
  • Operator: is one of
  • Values: List of IMS org IDs

Testing

npm test

License

Apache-2.0

Additional Information