Gabriel
04/08/2026, 12:23 PMclient property on the Descope component in the Next.js SDK for this.
Is this the right approach for passing custom variables through the flow? Also, what’s the correct way to access this data inside the flow?Bhagwanta Yeole
04/08/2026, 1:42 PM<Descope
flowId="my-flow-id"
client={{ version: "1.2.0", planTier: "pro" }}
/>Gabriel
04/08/2026, 2:37 PMversion and planTier variables on the login flow?Gabriel
04/08/2026, 4:16 PMMeir Wahnon
04/08/2026, 4:18 PMBhagwanta Yeole
04/08/2026, 4:21 PMGabriel
04/08/2026, 4:22 PMGabriel
04/08/2026, 4:23 PM{{client.planTier}} to get the variable in the flow, but it didn't work.Bhagwanta Yeole
04/08/2026, 4:29 PMRahul Rijhwani
04/08/2026, 6:21 PM{{client.planTier}} isn't working is that the client prop is intended for browser/environment metadata (like browser name/version) and isn't available as a dynamic key inside flows or connectors.
To pass custom data like planTier and version into a connector, you should use the form prop instead:
<Descope
flowId="your-flow-id"
form={{
'planTier': 'pro',
'version': '1.2.0'
}}
/>
Then in your connector inside the flow, reference it as: {{form.planTier}} and {{form.version}}
The form inputs are fully accessible in flow actions, connectors, and conditionals.
Doc: https://docs.descope.com/flows/dynamic-keys/flow-inputsGabriel
04/08/2026, 6:23 PMGabriel
04/08/2026, 7:02 PMGabriel
04/08/2026, 7:05 PMGabriel
04/08/2026, 7:06 PMRahul Rijhwani
04/08/2026, 7:06 PMGabriel
04/08/2026, 7:06 PMGabriel
04/08/2026, 7:08 PMGabriel
04/08/2026, 7:14 PMGabriel
04/08/2026, 7:22 PMGabriel
04/08/2026, 7:22 PMGabriel
04/08/2026, 7:25 PMRahul Rijhwani
04/08/2026, 7:40 PM1:67 is caused by this line in your scriptlet:
const userEmail = formEmail || unauthUserEmail || userEmail
You're re-declaring userEmail with const while also referencing it on the right side. JavaScript's const creates a Temporal Dead Zone, so || userEmail hits the TDZ of the new variable instead of the scriptArg — causing the ReferenceError.
Fix it by renaming the const:
const resolvedEmail = formEmail || unauthUserEmail || userEmail
return { userEmail: resolvedEmail };
2. env scriptArg is mapped to wrong context key Your env arg is mapped to context "env" which doesn't exist as a Descope dynamic key — it's always undefined. Change it to form.env in the scriptlet args. Then pass it from your app:
<Descope form={{ clientId: 1004, env: 'production' }} />
And in the dashboard configure panel, set env → descopeDashboard to test that branch.
The form.clientId value itself IS flowing through correctly — the scriptlet crash was just preventing it from being used.Gabriel
04/08/2026, 7:42 PMGabriel
04/08/2026, 7:46 PMRahul Rijhwani
04/08/2026, 8:49 PMGabriel
04/08/2026, 10:02 PMBhagwanta Yeole
04/09/2026, 3:24 AMBhagwanta Yeole
04/09/2026, 3:25 AM{{form.variable_name}}Gabriel
04/09/2026, 3:11 PMGabriel
04/09/2026, 4:38 PMRahul Rijhwani
04/09/2026, 5:49 PMGabriel
04/09/2026, 5:58 PMGabriel
04/09/2026, 6:00 PMRahul Rijhwani
04/09/2026, 6:00 PMGabriel
04/09/2026, 6:01 PMGabriel
04/09/2026, 6:02 PMGabriel
04/09/2026, 6:02 PMRahul Rijhwani
04/09/2026, 7:08 PM