Skip to main content

Quickstart

Get Flux running in your project in under 5 minutes.

Install the SDK

Rust (Cargo)

cargo add flux-sdk

Python (pip)

pip install flux-sdk

Node.js (npm)

npm install @flux/sdk

Initialize Flux

Rust

use flux_sdk::Flux;

fn main() {
    let flux = Flux::init("your-api-key");

    // Auth is ready
    let user = flux.auth().verify_session(&token)?;

    // Feature flags are ready
    if flux.flags().is_enabled("new-dashboard", &user) {
        // show new dashboard
    }

    // Billing is ready
    let plan = flux.billing().get_plan(&user.org_id)?;
}

Python

import flux

flux.init("your-api-key")

# Auth is ready
user = flux.auth.verify_session(token)

# Feature flags are ready
if flux.flags.is_enabled("new-dashboard", user):
    # show new dashboard
    pass

# Billing is ready
plan = flux.billing.get_plan(user.org_id)

Node.js

import Flux from '@flux/sdk';

const flux = Flux.init('your-api-key');

// Auth is ready
const user = await flux.auth.verifySession(token);

// Feature flags are ready
if (await flux.flags.isEnabled('new-dashboard', user)) {
  // show new dashboard
}

// Billing is ready
const plan = await flux.billing.getPlan(user.orgId);

Next Steps