# Plan Onboarding Prefill

Pre-fill or skip onboarding survey questions for personalized plans. All fields are optional — only provided fields will be pre-filled and their corresponding screens will be skipped. If all answers are provided for a goal-based plan, the user goes straight to results.

**Availability:** This parameter is used with \`createCustomComponentView\` (Swift, Kotlin, Flutter) or the \`CUSTOM_COMPONENT\` integration option (React Native) with \`route: "plan-onboarding"\`.

| Parameter | Type | Description |
|-----------|------|-------------|
| route | string | Must be \`"plan-onboarding"\` for this feature to work |
| planOnboardingPrefill | object | Object containing prefill values for onboarding survey |
| planOnboardingPrefill.goal | string | User's fitness goal (e.g., "weight_loss") |
| planOnboardingPrefill.healthIssues | string[] | List of health issues (e.g., ["back_pain"]) |
| planOnboardingPrefill.injuries | string[] | List of injuries (empty array for none) |
| planOnboardingPrefill.duration | number | Preferred workout duration in minutes |
| planOnboardingPrefill.lifestyle | string | User's activity level (e.g., "sedentary", "active") |
| planOnboardingPrefill.assessmentOnly | boolean | When \`true\`, all survey screens (goal, health issues, injuries, duration, lifestyle) are skipped and the user lands directly on the fitness assessment. Any previously stored plan ID is cleared so a fresh personalized plan is generated after the assessment completes. All other prefill fields are ignored when this is set |

**\`assessmentOnly\` use case:** Use this for **reassessment flows** — when the user already has a profile (goal, lifestyle, etc.) recorded in your host app and you only want them to perform a fresh fitness assessment to regenerate their personalized plan. Don't combine it with the other prefill fields; they will be ignored.

**\`remind_me_later_clicked\` event:** When the user is on the Assessment screen inside the plan-onboarding flow and taps "Remind me later", the SDK posts a \`remind_me_later_clicked\` PostMessage so your host app can dismiss the SDK and schedule a follow-up prompt. This event is only fired from the plan-onboarding page.

**Plan Onboarding Prefill Configuration**

_Swift (iOS)_
```swift
// Use createCustomComponentView with route "plan-onboarding"
kinestex.createCustomComponentView(
    route: "plan-onboarding",
    customParams: [
        "planOnboardingPrefill": [
            "goal": "weight_loss",
            "healthIssues": ["back_pain"],
            "injuries": [],
            "duration": 30,
            "lifestyle": "sedentary"
        ]
    ]
)

// Reassessment-only flow (skips the entire survey)
kinestex.createCustomComponentView(
    route: "plan-onboarding",
    customParams: [
        "planOnboardingPrefill": [
            "assessmentOnly": true
        ]
    ]
)
```

_Kotlin (Android)_
```kotlin
// Use createCustomComponentView with route "plan-onboarding"
KinesteXSDK.createCustomComponentView(
    route = "plan-onboarding",
    customParams = mapOf(
        "planOnboardingPrefill" to mapOf(
            "goal" to "weight_loss",
            "healthIssues" to listOf("back_pain"),
            "injuries" to emptyList<String>(),
            "duration" to 30,
            "lifestyle" to "sedentary"
        )
    )
)
```

_React Native_
```jsx
// Use CUSTOM_COMPONENT integration with route "plan-onboarding"
const postData: IPostData = {
  key: 'YOUR_API_KEY',
  userId: 'user-123',
  company: 'YOUR_COMPANY',
  customParameters: {
    planOnboardingPrefill: {
      goal: 'weight_loss',
      healthIssues: ['back_pain'],
      injuries: [],
      duration: 30,
      lifestyle: 'sedentary',
    },
  },
};

<KinestexSDK
  data={postData}
  route="plan-onboarding"
  integrationOption={IntegrationOption.CUSTOM_COMPONENT}
  handleMessage={handleMessage}
/>
```

_Flutter_
```dart
// Use createCustomComponentView with route "plan-onboarding"
KinesteXAIFramework.createCustomComponentView(
  route: "plan-onboarding",
  customParams: {
    "planOnboardingPrefill": {
      "goal": "weight_loss",
      "healthIssues": ["back_pain"],
      "injuries": [],
      "duration": 30,
      "lifestyle": "sedentary",
    },
  },
);
```

_HTML / JavaScript_
```html
const srcURL = "https://ai.kinestex.com/plan-onboarding";

const postData = {
  userId: "user-123",
  company: "YOUR_COMPANY",
  key: "YOUR_API_KEY",
  planOnboardingPrefill: {
    goal: "weight_loss",
    healthIssues: ["back_pain"],
    injuries: [],
    duration: 30,
    lifestyle: "sedentary",
  },
};

// Reassessment-only flow (skips the entire survey)
const reassessmentPostData = {
  userId: "user-123",
  company: "YOUR_COMPANY",
  key: "YOUR_API_KEY",
  planOnboardingPrefill: {
    assessmentOnly: true,
  },
};
```

_React (TypeScript)_
```tsx
// Use CUSTOM_COMPONENT integration with route "plan-onboarding"
const postData: IPostData = {
  key: 'YOUR_API_KEY',
  userId: 'user-123',
  company: 'YOUR_COMPANY',
  customParameters: {
    planOnboardingPrefill: {
      goal: 'weight_loss',
      healthIssues: ['back_pain'],
      injuries: [],
      duration: 30,
      lifestyle: 'sedentary',
    },
  },
};

<KinestexSDK
  data={postData}
  route="plan-onboarding"
  integrationOption={IntegrationOption.CUSTOM_COMPONENT}
  handleMessage={handleMessage}
/>
```

---
Source: https://kinestex.com/docs/customization-parameters/plan-onboarding-prefill · Index: https://kinestex.com/llms.txt
