Skip to main content
Version: 2.34.0

Define Control Points

Aperture JavaScript SDK can be used to define feature control points within a JavaScript service.

Run the command below to install the SDK:

npm install @fluxninja/aperture-js

The next step is to create an Aperture Client instance, for which, the address of the organization created in Aperture Cloud and API key are needed. You can locate both these details by clicking on the Aperture tab in the sidebar menu of Aperture Cloud.


You can create an API key for your project in the Aperture Cloud UI. For detailed instructions on locating API Keys, refer to the API Keys section.

The created instance can then be used to start a flow:

The above code snippet is making startFlow calls to Aperture. For this call, it is important to specify the control point (awesomeFeature in the example) and business labels that will be aligned with the policy created in Aperture Cloud. For request prioritization use cases, it's important to set a higher gRPC deadline. This parameter specifies the maximum duration a request can remain in the queue. For each flow that is started, a shouldRun decision is made, determining whether to allow the request into the system or to rate limit it. In this example, we only see log returns, but in a production environment, actual business logic can be executed when a request is allowed. It is important to make the end call made after processing each request, to send telemetry data that would provide granular visibility for each flow.

For more context on using the Aperture JavaScript SDK to set feature control points, refer to the example app available in the repository.