pushinbr / pam-native-feature-flags
Typed targeting, deterministic rollouts and offline feature-flag snapshots for PAM Native.
Package info
github.com/push-in/pam-native-feature-flags
Type:pam-native-plugin
pkg:composer/pushinbr/pam-native-feature-flags
v0.1.1
2026-08-01 04:08 UTC
Requires
- php: ^8.4
- pushinbr/pam-native: ^0.6.1
Requires (Dev)
- pushinbr/pam-native-testing: ^0.1.0
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.