Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flipt-io/typed

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flipt-io/typed

[![npm](https://img.shields.io/npm/v/@flipt-io/typed?label=%40flipt-io%2Ftyped)](https://www.npmjs.com/package/@flipt-io/typed) ![status](https://img.shields.io/badge/status-experimental-purple)

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Flipt Typed

npm status

Flipt Typed

Generate static types from Flipt features. Validate your code against your feature flags.

Overview

Flipt Typed is a CLI tool that generates static types from Flipt features.yml files. It allows you to use Flipt feature flags in your code with type safety for flag keys, variants, and contexts.

It is currently experimental and under active development.

Language support is limited to TypeScript at the moment, however we plan to add support for other typed languages in the future.

Want support for your favorite language? Let us know!

Why

Why would you want to use Flipt Typed? Here are a few reasons:

  • Get IDE autocompletion and enable a safer and more streamlined development experience when using Flipt feature flags
  • Avoid typos and other errors when integrating Flipt flag evaluation into your codebase
  • Ensure that your code is always in sync with your Flipt features configuration
  • Enable easier refactoring/cleanup of unused flags with Go To Definition and Find References in your IDE

Usage

  1. Create Flags, Variants, Segments, etc in Flipt. See our Getting Started guide for more information.

  2. Export your Flipt features to a features.yml file via flipt export. See our export documentation for more information.

  3. Run npx @flipt-io/typed to generate static types from your features.yml file.

    Either copy and paste the output or pipe it to a file:

    npx @flipt-io/typed --lang ts --input /path/to/features.yml
    
    npx @flipt-io/typed --lang ts --input /path/to/features.yml > /types/flipt.ts
    
  4. Use the generated types in your code:

    import { Flag } from "./types/flipt";
    
    let flag: Flag = { key: "new-feature", value: true };
    

Contributing

We welcome contributions to Flipt Typed! Please see our contributing guide for more information.

Found a bug or have a feature request? Open an issue.

License

Flipt Typed is licensed under the MIT License.

Acknowledgements

Thanks to @graup for the initial idea and prototype implementation of Flipt Typed!

FAQs

Package last updated on 06 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc