Shopify’s latest developer update brings a powerful new capability to the Shop SDK: Rich Authorization Requests (RAR) for lead capture. With RAR, your app can request exactly the profile fields it needs—phone number, birthdate, given name, or family name—directly during the authorization flow, and you can mark each field as required or optional. This post breaks down the change, explains who needs to pay attention, and provides a practical, code‑first guide to get you shipping today.
What changed
Lead capture now accepts a new attribute called attributes.authorizationDetails. It expects a serialized JSON array that describes the data types your app wants and whether each is mandatory. The schema looks like this:
javascript
const authorizationDetails = JSON.stringify([
{
type: 'urn:shopify:shop_app:data-sharing:v1',
datatypes: [
{name: 'phone_number', required: true},
{name: 'birthdate', required: false},
],
},
]);
When you pass this string to the lead‑capture constructor, Shopify presents the user with a consent screen that asks for any missing values. Required fields must be filled; optional ones can be skipped. If the user declines the whole authorization, the onComplete callback will not include a shopConsentToken, and your app should handle that case gracefully.
Who is affected
The change is scoped to apps that use the Shop SDK lead‑capture flow. If you already integrate lead capture, nothing breaks—RAR is opt‑in. However, if you want to collect richer data (e.g., a customer’s birthdate), you’ll need to add the new attribute and, on the server side, have a client secret and a trusted backend to exchange the shopConsentTokenfor actual user data via the Shop Partners API.
How to implement Rich Authorization Requests
Testing and validation
Before you push to production, run through four scenarios:
Testing in a development store with the Shop SDK sandbox mode will give you fast feedback.
Action checklist for developers
Conclusion & next steps
Rich Authorization Requests give you granular control over the data you need, improve the user experience by surfacing only the missing pieces, and keep your app compliant with Shopify’s consent model. By following the steps above, you can upgrade your existing lead‑capture integration with minimal risk and start delivering richer, more personalized experiences for merchants and their customers.
Ready to try it out? Open your development store, add the new attribute, and watch the consent screen adapt in real time. If you hit any snags, the Shopify Dev Forums and the Lead Capture documentation are great places to ask questions.
Happy building!
