Medusa v2 plugin to bidirectionally sync Medusa products, inventory and orders with a Faire brand account via the Faire External Platform API (OAuth 2.0).
A Medusa v2 plugin that bidirectionally syncs your Medusa products, inventory and orders with a Faire brand account via the Faire External Platform API (OAuth 2.0). It handles the OAuth connect flow, product push (create/update + inventory), bulk product sync, bulk order ingestion, and inbound Faire webhooks for order/inventory/product events.
⚠️ Note on API specifics. Faire's developer portal is access-gated, so this plugin's endpoint paths, payload shapes and webhook signature scheme reflect the publicly documented v2 surface and standard OAuth2 conventions. If your Faire app uses a different base URL, token header, or signing scheme, override via the options/env vars below — the client is intentionally permissive. Verify against your Faire app's documentation before going live.
1npm install @jytextiles/medusa-plugin-faire-store-sync2# or3yarn add @jytextiles/medusa-plugin-faire-store-sync4# or5pnpm add @jytextiles/medusa-plugin-faire-store-syncRegister the plugin in :
1module.exports = defineConfig({2 // ...3 plugins: [4 {5 resolve: "@jytextiles/medusa-plugin-faire-store-sync",6 options: {7 clientId: process.env.FAIRE_APP_ID,8 clientSecret: process.env.FAIRE_APP_SECRET,9 redirectUri:10 process.env.FAIRE_REDIRECT_URI ??11 "http://localhost:9000/app/settings/oauth/faire/callback",12 // Optional overrides (defaults shown):13 // apiBase: "https://faire.com/external-api/v2",14 // authUrl: "https://faire.com/oauth2/authorize",15 // tokenUrl: "https://www.faire.com/api/external-api-oauth2/token",16 },17 },18 ],19})Options can be supplied via the object above or the matching environment variables (env takes precedence):
| Option | Env var | Required | Description |
|---|---|---|---|
| yes | Your Faire app's application id. | ||
| yes | Your Faire app's application secret. | ||
| no | OAuth callback URL. Must match your Faire app's registered redirect. | ||
| no | Override the Faire API base URL (e.g. for sandbox). | ||
| no | Override the OAuth authorize URL. | ||
| no | Override the OAuth token URL. |
After installing, run your project's migrations so the plugin's tables are created:
npx medusa db:migrate| Env var | Default | Effect |
|---|---|---|
| Set to disable creating Medusa orders from Faire. | ||
| Set to decrement Medusa stock on Faire order ingest. | ||
| Set to disable the scheduled order-pull job. |
| Method | Route | Purpose |
|---|---|---|
| GET | Connection + readiness status | |
| GET/POST | Read / save sync settings | |
| GET | Start the OAuth2 flow | |
| POST | OAuth2 callback (called by the SPA) | |
| POST | Disconnect the brand | |
| POST | Sync a single product | |
| POST | Sync multiple products (background workflow, 202) | |
| GET | Poll bulk product-sync progress | |
| POST | Pull Faire orders (background workflow, 202) | |
| GET | Poll bulk order-ingest progress | |
| GET | List sync records | |
| GET/POST | Fetch / retry a sync record | |
| GET | The connected Faire brand | |
| GET | Products already on Faire |
1# Build the plugin (compiles to .medusa/server, then restructures via postbuild)2npm run build3
4# Watch mode while developing against a local Medusa app5npm run dev6
7# Generate a migration after changing a model8npm run db:generate9
10# Run tests11npm run test