@wix/agent-skills 1.15.1 → 1.16.0
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/README.md +3 -7
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +4 -1
- package/skills/wix-app/references/APP_TOOLS.md +134 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +1 -1
- package/skills/wix-app/references/DASHBOARD_PAGE.md +0 -10
- package/skills/wix-app/references/DATA_COLLECTION.md +1 -1
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +28 -9
- package/skills/wix-app/references/SERVICE_PLUGIN.md +12 -10
- package/skills/wix-app/references/app-tools/TOOLS.md +75 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +2 -2
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +172 -0
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +138 -0
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +23 -2
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +29 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +27 -2
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +5 -3
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +18 -1
- package/skills/wix-app/references/editor-react-component/PARTS.md +15 -2
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +2 -3
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +13 -9
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +4 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +4 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +3 -1
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +4 -0
- package/skills/wix-app/references/service-plugin/TOOLS_PROVIDER.md +54 -0
- package/skills/wix-app/references/stores/QUERY.md +32 -0
- package/skills/wix-docs/SKILL.md +35 -3
- package/skills/wix-headless/SKILL.md +3 -1
- package/skills/wix-headless/references/CONTENT.md +36 -0
- package/skills/wix-headless/references/DESIGN.md +54 -0
- package/skills/wix-headless/references/DISCOVERY.md +24 -0
- package/skills/wix-headless/references/IMAGE_GENERATION.md +10 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +3 -2
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +32 -23
- package/skills/wix-headless/references/managed/CONNECT.md +1 -1
- package/skills/wix-headless/references/managed/CREATE.md +14 -0
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +25 -0
- package/skills/wix-manage/SKILL.md +123 -7
- package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +41 -0
- package/skills/wix-manage/references/app-installation/app-installation-dashboard-navigation.md +28 -0
- package/skills/wix-manage/references/blog/blog-dashboard-navigation.md +56 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +31 -6
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -1
- package/skills/wix-manage/references/bookings/bookings-dashboard-navigation.md +63 -0
- package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +10 -1
- package/skills/wix-manage/references/cms/cms-dashboard-navigation.md +44 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +31 -3
- package/skills/wix-manage/references/cms/cms-publishing-flow.md +287 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +27 -1
- package/skills/wix-manage/references/contacts/contacts-dashboard-navigation.md +46 -0
- package/skills/wix-manage/references/contacts/create-a-contact.md +82 -0
- package/skills/wix-manage/references/contacts/update-a-contact.md +119 -0
- package/skills/wix-manage/references/dashboard-navigation/dashboard-navigation.md +82 -0
- package/skills/wix-manage/references/dashboard-navigation/routes.json +1733 -0
- package/skills/wix-manage/references/domains/domains-dashboard-navigation.md +32 -0
- package/skills/wix-manage/references/ecommerce/ecom-pricing.md +4 -4
- package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
- package/skills/wix-manage/references/ecommerce/gift-cards/ecom-gift-cards-goal-sell-gift-cards.md +338 -0
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-discount-rule.md +42 -78
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-bundle-and-save.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-stock-mover.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-upsell-boost.md +1 -1
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +90 -92
- package/skills/wix-manage/references/events/create-wix-event.md +176 -0
- package/skills/wix-manage/references/events/manage-wix-events.md +174 -0
- package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +44 -0
- package/skills/wix-manage/references/get-paid/get-paid-dashboard-navigation.md +52 -0
- package/skills/wix-manage/references/google-ads/billing-and-payment.md +80 -0
- package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +212 -0
- package/skills/wix-manage/references/google-ads/get-campaign-suggestions.md +110 -0
- package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +25 -0
- package/skills/wix-manage/references/google-ads/install-and-create-account.md +155 -0
- package/skills/wix-manage/references/google-ads/manage-campaign-lifecycle.md +63 -0
- package/skills/wix-manage/references/google-ads/query-campaign-analytics.md +155 -0
- package/skills/wix-manage/references/marketing/marketing-dashboard-navigation.md +52 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +99 -1
- package/skills/wix-manage/references/pricing-plans/pricing-plans-dashboard-navigation.md +45 -0
- package/skills/wix-manage/references/restaurants/restaurants-dashboard-navigation.md +68 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +94 -125
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +48 -9
- package/skills/wix-manage/references/site-properties/site-properties-dashboard-navigation.md +31 -0
- package/skills/wix-manage/references/sites/create-headless-site.md +52 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +2 -25
- package/skills/wix-manage/references/sites/site-import.md +163 -190
- package/skills/wix-manage/references/sites/sites-dashboard-navigation.md +29 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +17 -1
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +26 -8
- package/skills/wix-manage/references/stores/stores-dashboard-navigation.md +65 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +39 -7
- package/skills/wix-replatform/.publish-manifest.json +8 -0
- package/skills/wix-replatform/SKILL.md +693 -0
- package/skills/wix-replatform/lib/artifact-freshness.js +215 -0
- package/skills/wix-replatform/lib/completion-report.js +200 -0
- package/skills/wix-replatform/lib/config-env.js +59 -0
- package/skills/wix-replatform/lib/execution-manifest.js +185 -0
- package/skills/wix-replatform/lib/execution-state.js +173 -0
- package/skills/wix-replatform/lib/import-recovery.js +313 -0
- package/skills/wix-replatform/lib/local-state.js +642 -0
- package/skills/wix-replatform/lib/orchestration-preflight.js +143 -0
- package/skills/wix-replatform/lib/orchestration-router.js +122 -0
- package/skills/wix-replatform/lib/orchestration-state.js +455 -0
- package/skills/wix-replatform/lib/progress-log.js +224 -0
- package/skills/wix-replatform/lib/progress-log.sh +140 -0
- package/skills/wix-replatform/lib/url-preservation-state.js +391 -0
- package/skills/wix-replatform/resources/rp-discovery/SKILL.md +184 -0
- package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +529 -0
- package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +316 -0
- package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +64 -0
- package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +1114 -0
- package/skills/wix-replatform/resources/rp-mapper/SKILL.md +430 -0
- package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +217 -0
- package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +148 -0
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +378 -0
- package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +183 -0
- package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +478 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +136 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +310 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +1081 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +618 -0
- package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +949 -0
- package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +196 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +66 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +60 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +95 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +82 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +256 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +249 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +444 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +774 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +71 -0
- package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +632 -0
- package/skills/wix-replatform/resources/rp-target-wix/SPEC-product-reviews-and-blog-authorship.md +330 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +21 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +19 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +39 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +36 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +131 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +21 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +97 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +528 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +13 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +53 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +84 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +25 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +90 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +64 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +141 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +384 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +260 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +238 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +237 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +238 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +2219 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +31 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +100 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +107 -0
- package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +344 -0
- package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +250 -0
- package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +1927 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +83 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +141 -0
- package/skills/wix-replatform/scripts/artifact-freshness.js +76 -0
- package/skills/wix-replatform/scripts/execution-manifest-validate.js +43 -0
- package/skills/wix-replatform/scripts/execution-state-prepare.js +128 -0
- package/skills/wix-replatform/scripts/orchestration-preflight.js +48 -0
- package/skills/wix-replatform/scripts/orchestration-route.js +46 -0
- package/skills/wix-replatform/scripts/orchestration-state.js +245 -0
- package/skills/wix-vibe-headless/SKILL.md +48 -25
- package/skills/wix-vibe-headless/install/deploy.cjs +95 -0
- package/skills/wix-vibe-headless/install/pin-agents-md.cjs +34 -0
- package/skills/wix-vibe-headless/platforms/README.md +8 -4
- package/skills/wix-vibe-headless/platforms/base44.md +133 -98
- package/skills/wix-vibe-headless/platforms/generic.md +99 -64
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +230 -119
- package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +43 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +25 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +35 -0
- package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +38 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +40 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +54 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +65 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +50 -0
- package/skills/wix-vibe-headless/references/blog/seed/SEED.md +103 -0
- package/skills/wix-vibe-headless/references/blog/seed/seed-blog.js +270 -0
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +260 -149
- package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +65 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +47 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +13 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +126 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +108 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +58 -0
- package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +95 -0
- package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +94 -0
- package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +89 -0
- package/skills/wix-vibe-headless/references/bookings/{wix-bookings-checkout.js → app/rest/wix-bookings-checkout.js} +1 -1
- package/skills/wix-vibe-headless/references/bookings/{wix-bookings-services.js → app/rest/wix-bookings-services.js} +87 -11
- package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +117 -0
- package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.js +333 -0
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +169 -147
- package/skills/wix-vibe-headless/references/cms/app/collection.config.js +31 -0
- package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +18 -0
- package/skills/wix-vibe-headless/references/cms/{wix-cms.js → app/rest/wix-cms.js} +47 -2
- package/skills/wix-vibe-headless/references/cms/seed/SEED.md +145 -0
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +228 -131
- package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +23 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +43 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +13 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +29 -0
- package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +57 -0
- package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +78 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +27 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +54 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +40 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +81 -0
- package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +48 -0
- package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +36 -0
- package/skills/wix-vibe-headless/references/events/{wix-events-browse.js → app/rest/wix-events-browse.js} +1 -1
- package/skills/wix-vibe-headless/references/events/seed/SEED.md +107 -0
- package/skills/wix-vibe-headless/references/events/seed/seed-events.js +251 -0
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +276 -188
- package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +101 -0
- package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +33 -0
- package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +21 -0
- package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +29 -0
- package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +54 -0
- package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +77 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +36 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +32 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +35 -0
- package/skills/wix-vibe-headless/references/members/{wix-members-auth.js → app/rest/wix-members-auth.js} +6 -3
- package/skills/wix-vibe-headless/references/members/install/Register.jsx +22 -0
- package/skills/wix-vibe-headless/references/members/seed/SEED.md +22 -0
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +233 -104
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +31 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +39 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +29 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +35 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +27 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +25 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +39 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +27 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +60 -0
- package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +94 -0
- package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.js +236 -0
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +240 -117
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +35 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +48 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +16 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +35 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +25 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +28 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +30 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +30 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +53 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +28 -0
- package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +86 -0
- package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.js +251 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +248 -124
- package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +81 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +71 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +43 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +21 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +60 -0
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +63 -0
- package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +32 -0
- package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +73 -0
- package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +28 -0
- package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +102 -0
- package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +180 -0
- package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.js +452 -0
- package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +56 -0
- package/skills/wix-vibe-headless/references/shared/{wix-client.js → app/rest/wix-client.js} +6 -8
- package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +6 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +263 -157
- package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +20 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +150 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +167 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +51 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +54 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +119 -0
- package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +71 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +109 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +98 -0
- package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +27 -0
- package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +139 -0
- package/skills/wix-vibe-headless/references/storefront/app/pages/Shop.jsx +75 -0
- package/skills/wix-vibe-headless/references/storefront/{wix-store-cart.js → app/rest/wix-store-cart.js} +1 -1
- package/skills/wix-vibe-headless/references/storefront/{wix-store-catalog.js → app/rest/wix-store-catalog.js} +20 -1
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +111 -0
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +299 -0
- /package/skills/wix-vibe-headless/references/blog/{wix-blog.js → app/rest/wix-blog.js} +0 -0
- /package/skills/wix-vibe-headless/references/events/{wix-events-registration.js → app/rest/wix-events-registration.js} +0 -0
- /package/skills/wix-vibe-headless/references/portfolio/{wix-portfolio.js → app/rest/wix-portfolio.js} +0 -0
- /package/skills/wix-vibe-headless/references/pricing-plans/{wix-pricing-plans.js → app/rest/wix-pricing-plans.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-menu.js → app/rest/wix-restaurants-menu.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-ordering.js → app/rest/wix-restaurants-ordering.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-reservations.js → app/rest/wix-restaurants-reservations.js} +0 -0
|
@@ -1,211 +1,299 @@
|
|
|
1
|
+
# Wix Members — ready-made custom-login client
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
The members client is **shipped as real files**, not snippets to regenerate. It's a complete
|
|
4
|
+
**custom login** — email+password sign-up/sign-in, "Continue with Google/Facebook" (and custom SSO),
|
|
5
|
+
a member session, an account area, and route gating — styled with your app's design tokens (base44's
|
|
6
|
+
`src/index.css` — the shadcn palette the design phase already set). Copy it into the app and wire the
|
|
7
|
+
routes — you generate almost none of the auth code (the OAuth state machine, PKCE, the hidden-iframe
|
|
8
|
+
token exchange, and the social `/callback` all ship and are correct).
|
|
3
9
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
**Custom login only.** The member types credentials in **your own form on your own page** (or clicks
|
|
11
|
+
your own social button) — they are **never redirected to a Wix-hosted login page**. Talks to Wix
|
|
12
|
+
directly over the public `WIX_CLIENT_ID`; login swaps the token set on the one shared client, so
|
|
13
|
+
**every later `wixApiRequest` runs as the member** (their cart, orders, plans, "my …" reads). Never
|
|
14
|
+
mock a logged-in member; never mint a second client after login.
|
|
7
15
|
|
|
8
|
-
|
|
9
|
-
|
|
16
|
+
## Prerequisites
|
|
17
|
+
- The site's **Wix OAuth app** (headless) is the auth target — members **self-register**, so there is
|
|
18
|
+
**nothing to seed** (see **Seeding** below); the client renders the shipped logged-out state until a
|
|
19
|
+
member signs in.
|
|
20
|
+
- The **Members Area app** installed *only if* you need member **profile** data (name, photo, roles,
|
|
21
|
+
custom fields). Pure "logged-in vs. not" gating needs no app — see **Identity vs. profile** below.
|
|
22
|
+
- The public headless **`WIX_CLIENT_ID`** from your prompt (buyer-facing, safe to hardcode/commit).
|
|
23
|
+
- **OAuth-app allow-listing — the #1 gotcha, a manual owner-only step you can't do from client code.**
|
|
24
|
+
Two *different* fields gate the two mechanisms:
|
|
10
25
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
| Mechanism | What must be allow-listed | OAuth-app field | On `localhost:4321`? |
|
|
27
|
+
| :-- | :-- | :-- | :-- |
|
|
28
|
+
| **credential** (your form) | your app **origin** (the hidden iframe `postMessage`s the code back) | `allowedRedirectDomains` | ✅ allowed by default |
|
|
29
|
+
| **social / SSO** | the **exact `/callback` URL** (full-page redirect target) | `allowedRedirectUris` | ❌ **must be added** |
|
|
15
30
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
with `pricing-plans` so the member can log in *before* the subscribe / "my subscription" surface.
|
|
31
|
+
`localhost:4321` is Wix's default-allowed dev **origin**, so **credential login works there with zero
|
|
32
|
+
setup**; social **still fails** until you add `http://localhost:4321/callback` to `allowedRedirectUris`.
|
|
33
|
+
Any non-default origin (deployed domain, other port) needs both the origin and `<origin>/callback`.
|
|
34
|
+
**Symptoms:** unregistered origin → credential login hangs then throws `MemberAuthError('timeout')`
|
|
35
|
+
(+ a console *"postMessage… target origin does not match"*); unregistered callback → the Wix
|
|
36
|
+
authorize page shows *"Invalid redirect URI"* before returning, so the client can't catch it.
|
|
23
37
|
|
|
24
|
-
|
|
38
|
+
> **⚠️ AGENT: surface this proactively.** As soon as a run uses social/SSO (or deploys credential
|
|
39
|
+
> login to a non-`4321` origin), **tell the user the exact URIs to add and where** (deep link under
|
|
40
|
+
> **Point the user to their dashboard**), and note that **social login stays dead until they do it**.
|
|
25
41
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| **Kick-off** | `register()` / `login()` | `startSocialLogin(idp, callbackUri)` |
|
|
31
|
-
| **Finish** | automatic on `SUCCESS` | `completeSocialLogin()` on the `/callback` page |
|
|
32
|
-
| **Custom sign-up fields?** | Yes (`register`'s `profile`) | No — the provider owns the identity |
|
|
33
|
-
| **Needs an allow-listed origin/URI?** | **Yes** — your app **origin** (postMessage target) | **Yes** — your `/callback` **URL** |
|
|
42
|
+
## STEP 1 — The client is already in `src/`
|
|
43
|
+
The install step (base44.md STEP 1) deployed the whole members UI client + REST scaffolds into
|
|
44
|
+
`src/` (imports use the `@/` alias → `src/`). Here's every file and what it is — **this is your map,
|
|
45
|
+
so you don't need to open them:**
|
|
34
46
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
| file | what it is |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `context/MemberContext.jsx` | `useMember()` provider: current member, `loggedIn`, `refresh()`, `logout()` |
|
|
50
|
+
| `hooks/useLoginForm.js` | credential state machine (login/register/verify, error mapping) — logic only |
|
|
51
|
+
| `components/LoginForm.jsx` | email+password form UI (sign-in/sign-up tabs, verify-code + pending phases) |
|
|
52
|
+
| `components/SocialButtons.jsx` | "Continue with Google/Facebook" buttons (kick off the redirect) |
|
|
53
|
+
| `components/MemberMenu.jsx` | header account control — "Log in" vs. member name + log-out (like a cart button) |
|
|
54
|
+
| `components/RequireAuth.jsx` | route gate: renders children for a member, else redirects to `/login` |
|
|
55
|
+
| `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP 4) |
|
|
56
|
+
| `pages/Login.jsx`, `pages/Account.jsx` | the shipped login + account routes (`/login`, `/account`) |
|
|
57
|
+
| `pages/Callback.jsx` | social/SSO return route — mount at **exactly** `/callback` |
|
|
58
|
+
| `rest/wix-config.js` | **you set the ids here** (STEP 2) |
|
|
59
|
+
| `rest/wix-client.js` + `rest/wix-members-auth.js` | REST transport + the auth helper (copy verbatim) |
|
|
38
60
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
`
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- **
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
61
|
+
They're already in place — go **straight to theming + wiring**, nothing to verify first. **Don't
|
|
62
|
+
`read_file` the shipped page/component/hook source to inspect it** — the table says what each is and
|
|
63
|
+
every shape you need is in the snippets below. Read a shipped file's source **only** on a real
|
|
64
|
+
fallback — a runtime error, or a field the snippets don't cover (see "Fallback only" at the end).
|
|
65
|
+
(Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
|
|
66
|
+
`references/members/app/` → `src/`.)
|
|
67
|
+
|
|
68
|
+
> **⚠️ Copy `wix-members-auth.js` verbatim — do NOT rewrite its internals.** The OAuth wire shapes are
|
|
69
|
+
> exact and unforgiving: the `createRedirectSession` body needs the `auth.authRequest` wrapper, flat
|
|
70
|
+
> PKCE fields, and `responseType`/`scope` — "simplifying" it returns **400** and login dies. Extend by
|
|
71
|
+
> *calling* the exports, never by editing them. Its full JSDoc (state machine, `profile`, errors) is at
|
|
72
|
+
> the top of the file — read that, not the whole body, if you need the contract.
|
|
73
|
+
|
|
74
|
+
## STEP 2 — Credentials
|
|
75
|
+
Write `src/rest/wix-config.js` with your `WIX_CLIENT_ID` and `WIX_METASITE_ID` from the prompt — the
|
|
76
|
+
one place both ids live.
|
|
77
|
+
|
|
78
|
+
## STEP 3 — Theme (nothing to style on the shipped components)
|
|
79
|
+
The shipped components carry **no palette of their own** — they render from base44's design tokens
|
|
80
|
+
in `src/index.css` (`:root`/`.dark`: `--background`, `--foreground`, `--card`, `--primary`, `--muted`,
|
|
81
|
+
`--border`, `--radius`, `--font-*`) via shadcn Tailwind classes (`bg-card`, `text-foreground`,
|
|
82
|
+
`bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg`, `font-display`). Those tokens
|
|
83
|
+
are **already set to the brand by the design phase**, so the shipped auth surfaces are themed with
|
|
84
|
+
zero work here. To adjust the palette, edit `index.css` (`:root` **and** `.dark`) — the base44 way;
|
|
85
|
+
**never add a parallel theme file (e.g. a `theme.css`) or restyle the shipped JSX.** Build the
|
|
86
|
+
Home/Header you add (STEP 4) from the **same** base44 tokens/classes so it matches automatically. A
|
|
87
|
+
dark brand is just base44's dark palette in `index.css` — no per-component work.
|
|
88
|
+
|
|
89
|
+
## STEP 4 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
|
|
90
|
+
**No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
|
|
91
|
+
`App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`, the **Base44 builder
|
|
92
|
+
account**) — edit it in, don't replace it. The Wix member session is separate and ships under its own
|
|
93
|
+
name, **`MemberProvider`/`useMember`**, so the two never collide (do NOT rename it to `useAuth`).
|
|
94
|
+
- Wrap the routed tree in `<MemberProvider>` (from `@/context/MemberContext`).
|
|
95
|
+
- Put your **header + footer in a `Layout`** that renders `<Outlet/>` between them, and nest every
|
|
96
|
+
route under one pathless `<Route element={<Layout/>}>`. Your brand chrome then wraps **every** page
|
|
97
|
+
— including the shipped `Login`/`Account`/`Callback` — so you **never edit the shipped pages to add
|
|
98
|
+
a header/footer** (they render inside `<Outlet/>` as-is).
|
|
99
|
+
- **Pin the top chrome as one fixed block.** Put `<WixManageBanner/>` (shipped, preview-only) **above**
|
|
100
|
+
your `<Header/>` inside a single `position:fixed` top region — the header itself is plain in-flow
|
|
101
|
+
markup, the region owns the fixing — so banner + header ride together (no scroll drift/gap). Pad
|
|
102
|
+
the content by the region's measured height so it clears the chrome and self-corrects when the
|
|
103
|
+
banner is dismissed.
|
|
104
|
+
- Routes under the Layout: `/login` → `Login`, `/callback` → `Callback` (both shipped, as-is), and
|
|
105
|
+
`/account` → `Account` **wrapped in `<RequireAuth>`** so a visitor is bounced to `/login`. **You add
|
|
106
|
+
`/` → your own Home** page. Gate your own member-only routes ("my orders", "my plans") the same way.
|
|
107
|
+
|
|
108
|
+
```jsx
|
|
109
|
+
import { useRef, useState, useEffect } from "react";
|
|
110
|
+
import { Routes, Route, Outlet } from "react-router-dom";
|
|
111
|
+
import { MemberProvider } from "@/context/MemberContext";
|
|
112
|
+
import WixManageBanner from "@/components/WixManageBanner"; // shipped, preview-only · default export, no props
|
|
113
|
+
import RequireAuth from "@/components/RequireAuth"; // shipped route gate
|
|
114
|
+
import Login from "@/pages/Login"; // shipped · default export, no props
|
|
115
|
+
import Account from "@/pages/Account"; // shipped · default export, no props
|
|
116
|
+
import Callback from "@/pages/Callback"; // shipped · default export, no props
|
|
117
|
+
import Home from "@/pages/Home"; // YOU build
|
|
118
|
+
import Header from "@/components/Header"; // YOU build — plain in-flow markup, NOT position:fixed
|
|
119
|
+
import Footer from "@/components/Footer"; // YOU build
|
|
120
|
+
|
|
121
|
+
function Layout() {
|
|
122
|
+
const topRef = useRef(null);
|
|
123
|
+
const [offset, setOffset] = useState(0);
|
|
124
|
+
useEffect(() => { // measure the fixed region → pad content below it
|
|
125
|
+
const ro = new ResizeObserver(() => setOffset(topRef.current?.offsetHeight ?? 0));
|
|
126
|
+
if (topRef.current) ro.observe(topRef.current);
|
|
127
|
+
return () => ro.disconnect();
|
|
128
|
+
}, []);
|
|
129
|
+
return (<>
|
|
130
|
+
<div ref={topRef} style={{ position: "fixed", top: 0, left: 0, right: 0, zIndex: 50 }}>
|
|
131
|
+
<WixManageBanner /> {/* null on the published site / when dismissed */}
|
|
132
|
+
<Header /> {/* your brand header, in-flow inside this fixed block */}
|
|
133
|
+
</div>
|
|
134
|
+
<div style={{ paddingTop: offset }}> {/* clears the chrome; shrinks when the banner is dismissed */}
|
|
135
|
+
<Outlet /> {/* shipped Login/Account/Callback render here, untouched */}
|
|
136
|
+
<Footer />
|
|
137
|
+
</div>
|
|
138
|
+
</>);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
<MemberProvider>
|
|
142
|
+
<Routes>
|
|
143
|
+
<Route element={<Layout />}> {/* chrome wraps all */}
|
|
144
|
+
<Route path="/" element={<Home />} /> {/* yours */}
|
|
145
|
+
<Route path="/login" element={<Login />} /> {/* shipped, as-is */}
|
|
146
|
+
<Route path="/callback" element={<Callback />} /> {/* shipped — must be /callback */}
|
|
147
|
+
<Route path="/account" element={<RequireAuth><Account /></RequireAuth>} /> {/* gated, shipped */}
|
|
148
|
+
</Route>
|
|
149
|
+
</Routes>
|
|
150
|
+
</MemberProvider>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## What you build (not shipped)
|
|
154
|
+
The **home / landing page**, the **`Header`** (mount `<MemberMenu/>` in it) and a **`Footer`** — the
|
|
155
|
+
two you drop into the `Layout` (STEP 4) so they wrap every route — plus the overall brand story,
|
|
156
|
+
styled from the same base44 tokens/classes. The nav's account control is a `<MemberMenu/>` (shows
|
|
157
|
+
"Log in" for a visitor, the member's name + log-out once signed in — render it as-is, don't wrap it in
|
|
158
|
+
your own auth text button):
|
|
159
|
+
|
|
160
|
+
```jsx
|
|
161
|
+
import { useState, useEffect } from "react";
|
|
162
|
+
import { Link } from "react-router-dom";
|
|
163
|
+
import MemberMenu from "@/components/MemberMenu";
|
|
164
|
+
|
|
165
|
+
// Responsive header: choose ONE branch with a state flag, so <MemberMenu/> mounts once.
|
|
166
|
+
// Do NOT render a desktop nav AND a mobile nav toggled by `hidden md:flex` / `md:hidden`:
|
|
167
|
+
// these navs are inline-styled, and an inline `display` beats a Tailwind class, so `hidden`
|
|
168
|
+
// never applies — BOTH branches render and you get two menus. One branch = one menu.
|
|
169
|
+
export function Header() {
|
|
170
|
+
const [mobile, setMobile] = useState(() => window.innerWidth < 768);
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
const onResize = () => setMobile(window.innerWidth < 768);
|
|
173
|
+
window.addEventListener("resize", onResize); // keep it reactive to viewport changes
|
|
174
|
+
return () => window.removeEventListener("resize", onResize);
|
|
175
|
+
}, []);
|
|
176
|
+
return (
|
|
177
|
+
<nav style={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}>
|
|
178
|
+
{/* brand/logo */}
|
|
179
|
+
{mobile
|
|
180
|
+
? <YourMenu /> // your hamburger + <MemberMenu/> here
|
|
181
|
+
: <div style={{ display: "flex", gap: 24 }}><Link to="/">Home</Link><MemberMenu /></div>}
|
|
182
|
+
</nav>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
Everything visual reads base44's design tokens (`index.css`), so your home/nav match the shipped pages automatically.
|
|
187
|
+
|
|
188
|
+
**Editing a component and the change doesn't show? It's the preview, not your code.** The dev preview
|
|
189
|
+
can serve a stale module after a write. Before diagnosing a visual bug you just "fixed", do a fresh
|
|
190
|
+
full navigate/reload of the preview and re-check — don't keep rewriting correct code against a stale
|
|
191
|
+
render.
|
|
192
|
+
|
|
193
|
+
## Using the client from your own UI (session, gating, "my …" reads)
|
|
194
|
+
|
|
195
|
+
```jsx
|
|
196
|
+
import { useMember } from "@/context/MemberContext";
|
|
197
|
+
|
|
198
|
+
// useMember() gives:
|
|
199
|
+
// { member, loggedIn, loading, refresh(), logout(returnTo?) }
|
|
200
|
+
// - member is null for a visitor OR when the Members Area app isn't installed (loggedIn still true).
|
|
201
|
+
// - login/register happen in the shipped LoginForm; call refresh() after your own login call.
|
|
202
|
+
|
|
203
|
+
function Greeting() {
|
|
204
|
+
const { loggedIn, member, loading } = useMember();
|
|
205
|
+
if (loading) return null;
|
|
206
|
+
return loggedIn ? <span>Hi, {member?.profile?.nickname || "member"}</span> : <a href="/login">Log in</a>;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// A member-only read runs as the member on the SAME shared client — no extra auth, no `elevate`:
|
|
210
|
+
import { wixApiRequest } from "@/rest/wix-client";
|
|
211
|
+
const { orders } = await wixApiRequest("/ecom/v1/orders/query", { body: { query: {} } }); // member's own
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**"My items" in a CMS collection** (member-owned rows) → the **OWNED RECORDS** recipe in
|
|
215
|
+
`references/cms/INSTRUCTIONS.md`. Two facts from this vertical carry over: the member id lives at
|
|
216
|
+
**`member.id`**, and `member` is `null` for a logged-in member whenever the Members Area app is absent
|
|
217
|
+
(see *Identity vs. profile* below). Because of that second one, prefer a collection seeded
|
|
218
|
+
`read: SITE_MEMBER_AUTHOR` — the server scopes reads by the caller's own token, so it works in both states.
|
|
219
|
+
|
|
220
|
+
## Extending the client — the auth helper's exports (copy as-is, do NOT re-derive)
|
|
221
|
+
Building auth UI beyond the shipped pages? Call these exports (from `@/rest/wix-members-auth`) — the
|
|
222
|
+
same ones the shipped hook/pages use:
|
|
102
223
|
|
|
103
224
|
```js
|
|
104
|
-
|
|
225
|
+
// (A) Credential — handle EVERY branch, not just SUCCESS. register/login/verifyEmail → { state, ... }:
|
|
226
|
+
import { login, register, verifyEmail, MemberAuthError } from "@/rest/wix-members-auth";
|
|
105
227
|
try {
|
|
106
228
|
const res = await login(email, password);
|
|
107
|
-
if (res.state === "SUCCESS")
|
|
108
|
-
else if (res.state === "REQUIRE_EMAIL_VERIFICATION")
|
|
109
|
-
else if (res.state === "REQUIRE_OWNER_APPROVAL")
|
|
229
|
+
if (res.state === "SUCCESS") { /* logged in; res.member (or null w/o Members Area app) */ }
|
|
230
|
+
else if (res.state === "REQUIRE_EMAIL_VERIFICATION") { /* 6-digit code emailed; verifyEmail(code, res.stateToken) */ }
|
|
231
|
+
else if (res.state === "REQUIRE_OWNER_APPROVAL") { /* show a pending notice — not an error */ }
|
|
110
232
|
} catch (e) {
|
|
111
|
-
if (e instanceof MemberAuthError)
|
|
233
|
+
if (e instanceof MemberAuthError) show(e.message); else throw e; // .code: invalidCredentials, emailAlreadyExists, …
|
|
112
234
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Custom sign-up fields go in `register`'s `profile` (`{ firstName, lastName, nickname, addresses, … }`).
|
|
116
|
-
Standard fields work as-is; arbitrary `customFields` keys must first be defined in the Members Area
|
|
117
|
-
app or they're silently dropped.
|
|
235
|
+
// Custom sign-up fields → register's 3rd arg `profile` ({ firstName, lastName, nickname, addresses, … }).
|
|
236
|
+
// Arbitrary customFields keys must be defined in the Members Area app first, or they're silently dropped.
|
|
118
237
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
const callbackUri = new URL("/callback", window.location.origin).href; // must be allow-listed
|
|
124
|
-
onGoogleClick = () => startSocialLogin(IDP.GOOGLE, callbackUri, window.location.pathname);
|
|
125
|
-
onFacebookClick = () => startSocialLogin(IDP.FACEBOOK, callbackUri, window.location.pathname);
|
|
126
|
-
|
|
127
|
-
// on the /callback page (a route/page at exactly that path):
|
|
128
|
-
import { completeSocialLogin } from "./rest/wix-members-auth.js";
|
|
129
|
-
const { member, returnTo } = await completeSocialLogin();
|
|
130
|
-
window.location.replace(returnTo || "/");
|
|
238
|
+
// (B) Social / SSO — button + the shipped /callback page:
|
|
239
|
+
import { startSocialLogin, IDP } from "@/rest/wix-members-auth";
|
|
240
|
+
const callbackUri = new URL("/callback", window.location.origin).href; // must be allow-listed
|
|
241
|
+
startSocialLogin(IDP.GOOGLE, callbackUri, window.location.pathname); // custom SSO: pass a connectionId as idp
|
|
131
242
|
```
|
|
132
|
-
|
|
133
|
-
`
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
- **Logout:** `await logout()` — clears local tokens and redirects through the Wix logout URL; the
|
|
140
|
-
client is a clean anonymous visitor afterward.
|
|
141
|
-
- **Persistence is automatic.** Member tokens live in the same `localStorage` the visitor token used,
|
|
142
|
-
so a reload stays logged in and tokens auto-refresh via `wix-client.js` — do **not** add your own.
|
|
243
|
+
|
|
244
|
+
Every export in `wix-members-auth.js` links its own reference page inline. The two areas they sit in
|
|
245
|
+
map onto the identity / profile split below — auth is the headless OAuth app, the profile is the
|
|
246
|
+
Members Area app:
|
|
247
|
+
- Headless authentication (login, register, verify, tokens): https://dev.wix.com/docs/api-reference/business-management/headless/authentication.md
|
|
248
|
+
- Headless redirects (social/SSO + logout): https://dev.wix.com/docs/api-reference/business-management/headless/redirects.md
|
|
249
|
+
- Members (the member profile, needs the Members Area app): https://dev.wix.com/docs/api-reference/crm/members-contacts/members.md
|
|
143
250
|
|
|
144
251
|
## Identity vs. profile — don't conflate them
|
|
145
252
|
- **Identity / auth** — sign up, log in, log out, "is this caller a member?". Native to the headless
|
|
146
253
|
OAuth app. **No app install needed** — every login mechanism here runs on this layer alone.
|
|
147
|
-
- **Member profile / Members Area** — name / photo / roles, an account page,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
- ✅ **Fail loudly.** The helper throws `MemberAuthError` on bad credentials, state mismatch, timeout,
|
|
167
|
-
and token-exchange failure — surface them; don't swallow.
|
|
168
|
-
- ⛔ **No `elevate` / admin scope.** A member reading their **own** data (profile, own orders /
|
|
169
|
-
bookings / plans) is authorized by the member token alone. There is no admin elevation on a
|
|
170
|
-
client-only front, and own-data reads don't need it.
|
|
171
|
-
- ⛔ **MFA / TOTP is not available headless.** The security layers are password + email verification +
|
|
172
|
-
reCAPTCHA, all **dashboard-governed** — document them as host-configurable, don't set them from code.
|
|
173
|
-
|
|
174
|
-
## Beyond the snippets
|
|
175
|
-
The helper covers sign-up / login / social / SSO / logout / current-member. For a genuine gap, extend
|
|
176
|
-
with `wixApiRequest` — but confirm the endpoint, method, and body in the API reference first (or via
|
|
177
|
-
the co-installed **`wix-docs`** skill). Never guess.
|
|
178
|
-
- Custom login (JS SDK, concepts mirror the REST calls): https://dev.wix.com/docs/go-headless/self-managed-headless/authentication/members/custom-login-page/custom-login/custom-login-using-the-js-sdk.md
|
|
179
|
-
- External / social login (REST): https://dev.wix.com/docs/rest/business-management/headless-authentication/redirects/create-redirect-session
|
|
180
|
-
- Retrieve Tokens (REST): https://dev.wix.com/docs/rest/business-management/headless-authentication/authentication/retrieve-tokens
|
|
181
|
-
- Members API (read/update profile, query members): https://dev.wix.com/docs/api-reference/members/members/members-v1/introduction
|
|
254
|
+
- **Member profile / Members Area** — name / photo / roles, an account page, custom-field definitions.
|
|
255
|
+
Served by the **Members Area app**, which must be installed. If `getCurrentMember()`/`useMember().member`
|
|
256
|
+
is `null` while `loggedIn` is `true`, suspect the app isn't installed — **not a code bug**.
|
|
257
|
+
|
|
258
|
+
Fallback only — when you hit an error or need something not shown here (password reset, custom SSO
|
|
259
|
+
connection ids, a profile field these snippets don't have): read the relevant shipped file under
|
|
260
|
+
`src/rest/`, or look it up via the **`wix-docs`** skill.
|
|
261
|
+
|
|
262
|
+
## Hard rules
|
|
263
|
+
- Set `WIX_CLIENT_ID` (STEP 2) — not the placeholder.
|
|
264
|
+
- Style via base44 design tokens (`index.css` / shadcn Tailwind classes), never by rewriting the shipped components or adding a parallel theme file.
|
|
265
|
+
- **Custom login only** — the member logs in on **your** UI; never redirect them to a Wix-hosted login page.
|
|
266
|
+
- **One shared client** — login swaps the token set on `wix-client.js`; reuse it for everything so the
|
|
267
|
+
member identity carries across the app. Never mint a second client or re-mint anonymously after login.
|
|
268
|
+
- Copy `wix-members-auth.js` verbatim; extend by *calling* its exports, never by editing them.
|
|
269
|
+
- Header/footer live in a `Layout` around `<Outlet/>` (STEP 4) — never edit the shipped `Login`/`Account`/`Callback` to add chrome; the fixed top region owns positioning (`<WixManageBanner/>` above a plain in-flow `<Header/>`).
|
|
270
|
+
- **Never fake a member** — no mock logged-in state, invented profile, or roles. Render the real member or the real logged-out state.
|
|
271
|
+
- **Fail loudly** — the helper throws `MemberAuthError`; surface `.message`, don't swallow it.
|
|
272
|
+
- No `elevate` / admin scope, and no headless MFA/TOTP — those security layers are dashboard-governed.
|
|
182
273
|
|
|
183
274
|
## Point the user to their dashboard
|
|
184
|
-
Some setup only happens in the Wix dashboard — always give the user the deep links
|
|
185
|
-
|
|
186
|
-
- **
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
- [ ] `
|
|
202
|
-
- [ ] Sign-up: `register()`
|
|
203
|
-
- [ ] Log-in: `login()` reaches `SUCCESS`; wrong password shows `invalidCredentials`, not a crash
|
|
204
|
-
- [ ] After login `
|
|
205
|
-
|
|
206
|
-
- [ ]
|
|
207
|
-
- [ ]
|
|
208
|
-
|
|
209
|
-
- [ ] Logout clears the session and the next load is a clean anonymous visitor
|
|
210
|
-
- [ ] No mocked member state, profile, or roles anywhere
|
|
211
|
-
- [ ] Told the user about any required dashboard setup (Members Area app, allowed redirect URIs) with deep links
|
|
275
|
+
Some setup only happens in the Wix dashboard — always give the user the deep links (substitute the
|
|
276
|
+
site's `metaSiteId` from the handoff / `ListWixSites`):
|
|
277
|
+
- **Allowed authorization redirect URIs** (the #1 gotcha) — `https://manage.wix.com/dashboard/{metaSiteId}/oauth-apps-settings`.
|
|
278
|
+
Add the **app origin** (for credential login off `localhost:4321`) and the **exact `/callback` URL**
|
|
279
|
+
(for social/SSO) — character-for-character matching your `startSocialLogin` `callbackUri`.
|
|
280
|
+
- **Members Area app** (profile data + custom fields) — `https://manage.wix.com/dashboard/{metaSiteId}/member-permissions`
|
|
281
|
+
- **Signup security** (email verification, owner approval, reCAPTCHA) — `Dashboard → Settings → Login & Security`
|
|
282
|
+
- **Custom SSO connection** (to obtain a `connectionId`) — the project's IAM / SSO settings in the Business Manager.
|
|
283
|
+
|
|
284
|
+
## Seeding
|
|
285
|
+
**Nothing to seed** — members self-register; there is no build-time member to create. See
|
|
286
|
+
`seed/SEED.md` (separate from this client build; the members work is entirely frontend wiring).
|
|
287
|
+
|
|
288
|
+
## Verify (before declaring done)
|
|
289
|
+
- [ ] Client files copied into `src/`; `WIX_CLIENT_ID` set (not the placeholder).
|
|
290
|
+
- [ ] Brand palette lives in `index.css` (`:root`/`.dark`); no parallel theme file; shipped components/pages not restyled or rewritten.
|
|
291
|
+
- [ ] Opened the vertical's data route(s) (not just the home page) — `/login` and `/account` — and confirmed the shipped components render themed (surface, text, brand) with images.
|
|
292
|
+
- [ ] `Layout` (fixed `<WixManageBanner/>` + `<Header/>` region, then `<Outlet/>` + Footer) wraps all routes; shipped `Login`/`Account`/`Callback` untouched; content clears the fixed chrome; `<MemberProvider>` wraps the tree; `<MemberMenu/>` in the header.
|
|
293
|
+
- [ ] Sign-up: `register()` reaches `SUCCESS` (or `REQUIRE_EMAIL_VERIFICATION` handled via the code entry).
|
|
294
|
+
- [ ] Log-in: `login()` reaches `SUCCESS`; wrong password shows `invalidCredentials`, not a crash.
|
|
295
|
+
- [ ] After login `useMember().loggedIn` is `true`; `/account` renders the member (or the identity-only fallback with the Members Area app not installed — documented, not a bug). `/account` bounces a visitor to `/login`.
|
|
296
|
+
- [ ] Session survives reload (same client); logout clears it and the next load is a clean anonymous visitor.
|
|
297
|
+
- [ ] Social: the button redirects to the provider and `/callback` logs the member in (callback URL allow-listed), or is flagged as pending host setup.
|
|
298
|
+
- [ ] No mocked member state, profile, or roles anywhere.
|
|
299
|
+
- [ ] Told the user about any required dashboard setup (allowed redirect URIs, Members Area app) with deep links.
|