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

launchdarkly-api-typescript

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

launchdarkly-api-typescript

Build custom integrations with the LaunchDarkly REST API

  • 5.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22K
increased by9.01%
Maintainers
1
Weekly downloads
 
Created
Source

This repository contains a client library for LaunchDarkly's REST API. This client was automatically generated from our OpenAPI specification.

This REST API is for custom integrations, data export, or automating your feature flag workflows. DO NOT use this client library to include feature flags in your web or mobile application. To integrate feature flags with your application, please see the SDK documentation

Sample Code

import { FeatureFlagsApi, FeatureFlagsApiApiKeys, FeatureFlagBody } from "launchdarkly-api-typescript";

let apiInstance = new FeatureFlagsApi();
const apiKey = process.env.LD_API_KEY || '';
apiInstance.setApiKey(FeatureFlagsApiApiKeys.Token, apiKey);

const successCallback = function(data){
    console.log('API called successfully. Returned data: ' + JSON.stringify(data));
};
const errorCallback = function(error) {
    console.error('Error!', error);
    process.exit(1);
};

const createSuccessCallback = function(data){
    successCallback(data);

    // Clean up
    apiInstance.deleteFeatureFlag(projectName, keyName).then(successCallback, errorCallback);
};

const projectName = "openapi";
const keyName = "test-typescript";
const flagBody: FeatureFlagBody = {
    name: "Test Flag Typescript",
    key: keyName,
    variations: [{value: [1, 2]}, {value: [3, 4]}, {value: [5]}]
};

apiInstance.postFeatureFlag(projectName, flagBody).then(createSuccessCallback, errorCallback);

FAQs

Package last updated on 14 Jul 2021

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