@@ -5,7 +5,9 @@ description: >
55 credentials. Covers the /v2/oauth2/token endpoint, environments
66 (ote, prod), required headers, scopes, and monetary value formats.
77 Always collect client ID, client secret, store ID, and environment
8- from the user before making API calls. For API discovery and schema
8+ from the user before making API calls. Ensures @godaddy/react (FE
9+ checkout components) and @godaddy/cli (API discovery) are installed
10+ and up to date before proceeding. For API discovery and schema
911 introspection use @godaddy/cli (godaddy api list, godaddy api
1012 describe, godaddy api search) to find endpoints and required scopes.
1113 For checkout session creation use the Checkout API.
@@ -19,6 +21,97 @@ sources:
1921
2022## Setup
2123
24+ ### Ensure @godaddy/react is installed and up to date
25+
26+ The ` @godaddy/react ` package provides the React checkout components,
27+ hooks, and utilities used throughout this skill. Before proceeding,
28+ verify it is installed and running the latest version so you have the
29+ most recent component APIs and bug fixes.
30+
31+ ** Step 1 — Check for an existing installation:**
32+
33+ ``` bash
34+ # Check if installed in the current project
35+ pnpm ls @godaddy/react 2> /dev/null
36+
37+ # Check global install (less common for a component library)
38+ npm ls -g @godaddy/react --depth=0 2> /dev/null
39+ ```
40+
41+ If the package is found, skip to ** Step 3** (update to latest).
42+
43+ ** Step 2 — Install (if not found):**
44+
45+ Ask the user whether they want ` @godaddy/react ` installed as a
46+ ** production dependency** (most common for frontend apps), a
47+ ** dev dependency** , or ** globally** . Explain the trade-offs:
48+
49+ | Option | Command | When to choose |
50+ | ---------------------| ----------------------------------------| ------------------------------------------------------------------|
51+ | Dependency | ` pnpm add @godaddy/react@latest ` | App ships checkout UI — components are needed at runtime |
52+ | Dev dependency | ` pnpm add -D @godaddy/react@latest ` | Only used during development/build (e.g., design system tooling) |
53+ | Global | ` npm install -g @godaddy/react@latest ` | Quick prototyping outside a project |
54+
55+ Wait for the user's preference before running the install command.
56+
57+ ** Step 3 — Update to the latest version (if already installed):**
58+
59+ Capture the currently installed version ** before** updating so you can
60+ detect whether the package actually changed:
61+
62+ ``` bash
63+ # Record the current version
64+ OLD_VERSION=$( pnpm ls @godaddy/react --depth=0 2> /dev/null | grep @godaddy/react || echo " none" )
65+
66+ # Production or dev dependency update
67+ pnpm up @godaddy/react@latest
68+
69+ # Global update
70+ npm install -g @godaddy/react@latest
71+ ```
72+
73+ Use the same install location (project vs global) that was detected or
74+ chosen in the earlier steps.
75+
76+ ** Step 4 — Verify:**
77+
78+ ``` bash
79+ pnpm ls @godaddy/react
80+ ```
81+
82+ Confirm the listed version matches the latest release on npm. The
83+ package also ships ` @godaddy/localizations ` as a dependency — it will
84+ be installed automatically.
85+
86+ ** Step 5 — Re-read this skill if the package was updated:**
87+
88+ The ` @godaddy/react ` package ships its skill files in the ` skills/ `
89+ directory. When the package version changes, the skill instructions
90+ may have been updated (new components, changed APIs, revised patterns).
91+
92+ If the version changed after ** Step 3** (i.e. the new version differs
93+ from ` OLD_VERSION ` ), ** you must re-read this skill file before
94+ continuing** so you are operating on the latest instructions:
95+
96+ ```
97+ # Installed as a project dependency (most common)
98+ node_modules/@godaddy/react/skills/commerce-api/SKILL.md
99+
100+ # Installed globally (npm root -g to find prefix)
101+ $(npm root -g)/@godaddy/react/skills/commerce-api/SKILL.md
102+ ```
103+
104+ After re-reading, restart the Setup flow from the top — the new
105+ version may have added prerequisites, changed credential requirements,
106+ or introduced new sections.
107+
108+ > ** Why this matters:** Skill files are versioned with the package. If
109+ > you skip re-reading after an update, you may follow stale instructions
110+ > that reference deprecated APIs, missing components, or outdated
111+ > patterns. Always treat a version bump as a signal to reload.
112+
113+ ### Collect credentials
114+
22115Connecting to the GoDaddy Commerce Platform requires three pieces of
23116information from the user. ** Always ask for these before making any API
24117calls:**
0 commit comments