Skip to content

Where and when do I set a targetingkey in the Evaluation context if a provider requires one? #1161

Discussion options

You must be logged in to vote

Hey @RobertDiebels,we updated the SDK and the docs to show how setting context is intended: https://github.com/open-feature/js-sdk/tree/main/packages/angular/projects/angular-sdk#setting-evaluation-context

You now have the option to give the evaluation context to the module like shown in the following:

const initialContext = {
  user: {
    id: 'user123',
    role: 'admin',
  }
};

@NgModule({
  imports: [
    OpenFeatureModule.forRoot({
      provider: yourFeatureProvider,
      context: initialContext
    })
  ],
})
export class AppModule {}

Does that solve your issue?
I also tried to reproduce your issue with injecting the OpenFeatureModule at root level but it works for me using Appli…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@RobertDiebels
Comment options

@lukas-reining
Comment options

@lukas-reining
Comment options

Answer selected by lukas-reining
@lukas-reining
Comment options

@RobertDiebels
Comment options

@lukas-reining
Comment options

@RobertDiebels
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants