|
| 1 | +# Configuration Application Shopify |
| 2 | + |
| 3 | +## Étape 1: Créer l'app Shopify avec le CLI |
| 4 | + |
| 5 | +Dans le répertoire racine du projet, exécutez : |
| 6 | + |
| 7 | +```bash |
| 8 | +# Créer l'app Shopify dans un sous-dossier |
| 9 | +mkdir shopify-app |
| 10 | +cd shopify-app |
| 11 | +npm init @shopify/app@latest |
| 12 | +``` |
| 13 | + |
| 14 | +## Étape 2: Configuration de l'app |
| 15 | + |
| 16 | +Lors de l'initialisation, choisissez : |
| 17 | +- **App name**: RefSpring Affiliate Tracker |
| 18 | +- **Template**: Remix (recommended) |
| 19 | +- **Language**: TypeScript |
| 20 | +- **Package manager**: npm |
| 21 | + |
| 22 | +## Étape 3: Configuration des URLs |
| 23 | + |
| 24 | +Dans le fichier `shopify.app.toml` de l'app Shopify, configurez : |
| 25 | + |
| 26 | +```toml |
| 27 | +name = "refspring-affiliate-tracker" |
| 28 | +client_id = "YOUR_CLIENT_ID" |
| 29 | +webhooks.api_version = "2023-10" |
| 30 | + |
| 31 | +[application_url] |
| 32 | +redirect_url = "https://refspring.com/auth/shopify/callback" |
| 33 | + |
| 34 | +[webhooks] |
| 35 | +api_version = "2023-10" |
| 36 | + |
| 37 | +[[webhooks.subscriptions]] |
| 38 | +topics = ["orders/create", "orders/paid", "app/uninstalled"] |
| 39 | +uri = "https://refspring.com/api/shopify-webhooks" |
| 40 | +``` |
| 41 | + |
| 42 | +## Étape 4: Intégration avec Firebase Functions |
| 43 | + |
| 44 | +L'app Shopify utilisera nos Firebase Functions comme backend : |
| 45 | +- OAuth: `https://refspring.com/api/shopify-auth-callback` |
| 46 | +- Webhooks: `https://refspring.com/api/shopify-webhooks` |
| 47 | +- Configuration: `https://refspring.com/api/shopify-config` |
| 48 | + |
| 49 | +## Étape 5: Déploiement |
| 50 | + |
| 51 | +1. Déployez d'abord les Firebase Functions : `firebase deploy --only functions` |
| 52 | +2. Déployez l'app Shopify : `cd shopify-app && npm run deploy` |
| 53 | + |
| 54 | +## URLs importantes |
| 55 | + |
| 56 | +- App URL: L'URL générée par Shopify CLI |
| 57 | +- Redirect URL: `https://refspring.com/auth/shopify/callback` |
| 58 | +- Webhooks URL: `https://refspring.com/api/shopify-webhooks` |
0 commit comments