pushinbr/pam-native-feature-flags

Typed targeting, deterministic rollouts and offline feature-flag snapshots for PAM Native.

Maintainers

Package info

github.com/push-in/pam-native-feature-flags

Type:pam-native-plugin

pkg:composer/pushinbr/pam-native-feature-flags

Transparency log

Statistics

Installs: 12

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.1 2026-08-01 04:08 UTC

This package is auto-updated.

Last update: 2026-08-01 06:05:06 UTC


README

Typed feature flags with deterministic targeting, percentage rollouts, local overrides, exposure events and offline native snapshots.

composer require pushinbr/pam-native-feature-flags
pam mobile prepare
$provider = new InMemoryFlagProvider([
    new FlagDefinition(
        'checkout.new',
        FlagValue::boolean(false),
        rules: [
            new TargetingRule('brazil-pro', [
                new Condition('country', ConditionOperator::Equals, 'BR'),
                new Condition('plan', ConditionOperator::OneOf, ['pro', 'enterprise']),
            ], FlagValue::boolean(true)),
        ],
        rollout: [new PercentageRollout(1_000, FlagValue::boolean(true))],
    ),
]);

$flags = new FeatureFlags(
    $provider,
    new EvaluationContext($user->id, ['country' => 'BR', 'plan' => 'pro']),
);

if ($flags->boolean('checkout.new')) {
    // New checkout.
}

Rollouts use SHA-256 over flag-key + NUL + bucketing-id, then map the first unsigned 32 bits into 0...9999. Golden tests keep PHP, Kotlin and Swift assignments identical. Snapshot payloads are bounded to one MiB.