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

@softwareimaging/backstage-http

v1.4.2

Published

A local development config file provider for [Backstage]().

Readme

Backstage Local

A local development config file provider for Backstage.

Backstage is a headless environment & feature flag library that isn't tied to any specific service or format. It's a React based library that focuses on being easy to use and simple to integrate with any (and multiple) feature providers.

This provider is designed to be used in conjunction with other providers as it is returns an empty config in production builds.

Usage

If you haven't added Backstage to your project yet, install the main package.

npm i @softwareimaging/backstage --save

To get started with this provider, add it to your project also.

npm i @softwareimaging/backstage-local --save

Set up a file in your source code to export your development config from. This could be a js, ts or even JSON file - whatever works best for your workflow. Think carefully if you want to commit this. Add it to your .gitignore if you want to keep it private.

// backstage.local.js
const config = {
  variables: {
    apiKey: 'X-API-123456789',
    name: 'Backstage'
  },
  flags: {
    banner: true,
    promotion: true
  }
}

export default config

Import your config and supply it to the provider configuration. See the main library documentation for more information about using this in React. If you want your development settings to override other providers, make sure that your priorities reflect that. Higher number means a higher priority which means that it overrides other values with the same key from other providers.

// backstage-provider.jsx
import { Backstage } from '@softwareimaging/backstage'
import LocalProvider from '@softwareimaging/backstage-local'
import config from './backstage.local'

const BackstageProvider = ({ children }) => {
  const providers = [
    LocalProvider(1, { config }) // A higher priority
  ]

  return <Backstage providers={providers}>{children}</Backstage>
}

Use with TypeScript

It's recommend for TypeScript projects to use an interface to define the known options for your configuration for all of the type-safe-goodness that comes with TypeScript.

Firstly, define your config interface.

// backstage-config.ts
export interface MyConfig extends BackstageConfig {
  variables: {
    apiKey: string
    name: string
  }
  flags: {
    banner: boolean
    promotion: boolean
  }
}

export type Variables = keyof MyConfig['variables']
export type Flags = keyof MyConfig['flags']

It's also worth defining an extra export of your possible variable & flag names. This will make typing your hook calls have less boilerplate.

While that may look a bit weird, it is simply just a type represents the keys in the object. In the example above Variables is equal to 'apiKey' | 'name' and Flags is equal to 'banner' | 'promotion'.

To use this in your components, add the type to your hook calls.

import { useFlag } from '@softwareimaging/backstage'
import { Flags } from './backstage-config'
const Text = () => {
  const promotion = useFlag<Flags>('promotion') // <- This key is typechecked.
  return promotion ? <p>Discount: £10!</p> : <p>Normal pricing: £100</p>
}

In the context of this provider, if you want your local settings to have all of the settings in your config, just make your config object comply to the interface you just wrote.

// backstage.local.ts
import { MyConfig } from './backstage-config'
const config: MyConfig = {
  variables: {}, // <- This will fail, needs every settin
  flags: {
    promotion: true,
    banner: true
  }
}

If you want it to especially be an override of another provider, then make sure you have the object be a partial version of the interface.

// backstage.local.ts
import { MyConfig } from './backstage-config'
const config: Partial<MyConfig> = {
  variables: {}, // <- This is fine now.
  flags: {}
}