Skip to main content
Version: 2.25.2

Manually setting feature control points

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

To do so, first create an instance of ApertureClient:


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.

import { ApertureClient, Flow, FlowStatusEnum } from "@fluxninja/aperture-js";

export const apertureClient = new ApertureClient({
address: "",
agentAPIKey: "API_KEY",

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

async function handleRequest(req, res) {
const flow = await apertureClient.StartFlow("feature-name", {
labels: {
label_key: "some_user_id",
grpcCallOptions: {
deadline: + 300, // ms

if (flow.ShouldRun()) {
// Do Actual Work
} else {
// Handle flow rejection

if (flow) {

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