# Benefits Plan Assessment Web Component #

### Configuring component props 

In index.html update values for `profile-id`, `assessment-id` and `access-token`.

Values can be obtained from partner app:
* Ensure you are signed in to your Flare work profile in your browser.
* Visit https://apollo-partner.web.app/#/dashboard/benefits
*	Make sure you are in the Auto-Dev environment.
* Click on “Browse Benefits and Discounts”.
* Press Cmd + Option (on Mac) to open the Developer Tools and switch to the Network panel.
* To find the access token look for requests to https://autodev-partner.flarehr.com/flare-app-identity/backend/v1.0/auth/token. The token is in the response object.
* To find the `profile-id` search for requests to https://sdk.split.io/api/mySegments/`profile-id`.
* To find a valid `assessment-id` click on one of the assessments on the page and search for https://autodev-partner.flarehr.com/benefits-plan/workplace-backend/v2.0/activities/`assessment-id`/steps

### Navigating programmatically

The component exposes a `navigateTo` method directly on the element, allowing external code to change the active page:

```ts
const el = document.querySelector('benefits-plan-assessment') as HTMLElement & {
  navigateTo: (route: string) => void;
};

el.navigateTo('/consent');
el.navigateTo('/question');
el.navigateTo('/completion');
el.navigateTo('/ineligible/<stepId>');
```

### Running
```
npm ci
npm run dev
```

