@explorer02/cfm-survey-sdk 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/AGENT.md +17 -7
package/package.json
CHANGED
package/templates/AGENT.md
CHANGED
|
@@ -72,9 +72,14 @@ npm install @explorer02/cfm-survey-sdk @tanstack/react-query
|
|
|
72
72
|
> ```
|
|
73
73
|
> 3. Tell the client in chat: *"I am launching a premium interactive setup page in your browser. Please customize your survey preferences and logo there, then click Complete Setup."*
|
|
74
74
|
> 4. The wizard will open in the browser. The client will answer the questions and upload their logo there. **You do not need to do anything while the wizard is running — just wait.**
|
|
75
|
-
> 5. When `npx cfm-sdk init` exits (the terminal returns to a prompt), **immediately** read `./survey-config.json` and proceed
|
|
76
|
-
> 6. **Do NOT ask the client to invoke you again.** Continue automatically.
|
|
75
|
+
> 5. When `npx cfm-sdk init` exits (the terminal returns to a prompt), **immediately** read `./survey-config.json` and proceed.
|
|
77
76
|
|
|
77
|
+
### Phase 2b: Request Instance ID (STRICT REQUIREMENT)
|
|
78
|
+
|
|
79
|
+
Before proceeding to Phase 3, you **MUST STRICTLY ASK THE CLIENT** for the Survey Instance ID input:
|
|
80
|
+
*"Please provide the Instance ID (JWT Token) for your survey so I can configure the fetch logic."*
|
|
81
|
+
|
|
82
|
+
**DO NOT proceed with code generation** or build the SurveyPage until the client provides this Instance ID in the chat!
|
|
78
83
|
|
|
79
84
|
### Phase 3: Configuration Setup
|
|
80
85
|
|
|
@@ -627,12 +632,17 @@ const SURVEY_PLACEHOLDERS = {
|
|
|
627
632
|
export default function SurveyPage() {
|
|
628
633
|
const [selectedLanguage, setSelectedLanguage] = useState<string | undefined>("");
|
|
629
634
|
|
|
635
|
+
// ⚠️ MANDATORY: Pass the exact Instance ID that the client provided to you in the chat!
|
|
636
|
+
// The SDK will only fetch the survey data once this valid instance ID is passed.
|
|
637
|
+
const INPUT_OPTIONS = {
|
|
638
|
+
instanceId: '<<REPLACE_WITH_CLIENT_PROVIDED_INSTANCE_ID>>',
|
|
639
|
+
language: selectedLanguage,
|
|
640
|
+
debug: false,
|
|
641
|
+
placeholders: SURVEY_PLACEHOLDERS,
|
|
642
|
+
};
|
|
643
|
+
|
|
630
644
|
const { surveyQueryResults, submitSurveyResults, state, onAction } = useSurveySDK({
|
|
631
|
-
options:
|
|
632
|
-
language: selectedLanguage,
|
|
633
|
-
debug: false,
|
|
634
|
-
placeholders: SURVEY_PLACEHOLDERS,
|
|
635
|
-
},
|
|
645
|
+
options: INPUT_OPTIONS
|
|
636
646
|
});
|
|
637
647
|
|
|
638
648
|
const survey = surveyQueryResults.data;
|