@farm.js/integrations 0.1.50 → 0.1.51-beta.1

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.
Files changed (2) hide show
  1. package/README.md +114 -3
  2. package/package.json +18 -18
package/README.md CHANGED
@@ -1,11 +1,122 @@
1
1
  # @farm.js/integrations
2
2
 
3
- Compatibility package that re-exports official Farm.js integrations
3
+ Compatibility re-exports for Farm.js applications that import integrations from
4
+ `@farm.js/integrations` or one of its subpaths. Each subpath forwards to a dedicated integration
5
+ package, so an existing import keeps resolving to the same factory, client, and types.
4
6
 
5
7
  See [Stability and Support](https://farmjs.dev/docs/stability) for what this package guarantees.
6
8
 
9
+ ## New code should import the dedicated package
10
+
11
+ This package contains no integration code of its own. Every provider ships as a dedicated package,
12
+ such as `@farm.js/stripe` or `@farm.js/clerk`. Those are the packages `farm add integration`
13
+ installs, the generated starters import, and the documentation uses. Keep this package only while
14
+ an app still has the older imports, and move them over when convenient:
15
+
16
+ ```ts
17
+ // Before
18
+ import { stripe } from "@farm.js/integrations/stripe";
19
+ import { stripeClient } from "@farm.js/integrations/stripe/client";
20
+
21
+ // After
22
+ import { stripe } from "@farm.js/stripe";
23
+ import { stripeClient } from "@farm.js/stripe/client";
24
+ ```
25
+
26
+ The exports are the same objects, so the move is an import rename. Nothing else in
27
+ `farm.config.ts` or the application changes.
28
+
29
+ ## Install
30
+
7
31
  ```bash
8
- npm install @farm.js/integrations
32
+ pnpm add @farm.js/integrations
9
33
  ```
10
34
 
11
- See the [Farm.js repository](https://github.com/farming-labs/farm.js) for documentation, examples, and support.
35
+ Every dedicated package in the table below is a regular dependency and installs with it. Their
36
+ provider SDK peers do not. Install those the way each dedicated package asks, for example
37
+ `@clerk/react` for Clerk, `@sanity/client` for Sanity, and `@strapi/client` for Strapi.
38
+
39
+ ## Usage
40
+
41
+ An existing configuration keeps working unchanged:
42
+
43
+ ```ts
44
+ import { defineConfig } from "@farm.js/core";
45
+ import { stripe } from "@farm.js/integrations/stripe";
46
+
47
+ export default defineConfig({
48
+ integrations: {
49
+ billing: stripe({
50
+ secretKey: process.env.STRIPE_SECRET_KEY,
51
+ webhookSecret: process.env.STRIPE_WEBHOOK_SECRET,
52
+ }),
53
+ },
54
+ });
55
+ ```
56
+
57
+ ## Subpath mapping
58
+
59
+ Each subpath re-exports everything from its target.
60
+
61
+ | Compatibility import | Import instead |
62
+ | --------------------------------------- | ---------------------------- |
63
+ | `@farm.js/integrations/ai` | `@farm.js/ai` |
64
+ | `@farm.js/integrations/auth0` | `@farm.js/auth0` |
65
+ | `@farm.js/integrations/auth0/client` | `@farm.js/auth0/client` |
66
+ | `@farm.js/integrations/authjs` | `@farm.js/authjs` |
67
+ | `@farm.js/integrations/autumn` | `@farm.js/autumn` |
68
+ | `@farm.js/integrations/autumn/client` | `@farm.js/autumn/client` |
69
+ | `@farm.js/integrations/better-auth` | `@farm.js/better-auth` |
70
+ | `@farm.js/integrations/clerk` | `@farm.js/clerk` |
71
+ | `@farm.js/integrations/email` | `@farm.js/email` |
72
+ | `@farm.js/integrations/email/client` | `@farm.js/email/client` |
73
+ | `@farm.js/integrations/email/schedule` | `@farm.js/email/schedule` |
74
+ | `@farm.js/integrations/jobs` | `@farm.js/jobs` |
75
+ | `@farm.js/integrations/polar` | `@farm.js/polar` |
76
+ | `@farm.js/integrations/polar/client` | `@farm.js/polar/client` |
77
+ | `@farm.js/integrations/sanity` | `@farm.js/sanity` |
78
+ | `@farm.js/integrations/strapi` | `@farm.js/strapi` |
79
+ | `@farm.js/integrations/stripe` | `@farm.js/stripe` |
80
+ | `@farm.js/integrations/stripe/client` | `@farm.js/stripe/client` |
81
+ | `@farm.js/integrations/supabase` | `@farm.js/supabase` |
82
+ | `@farm.js/integrations/supabase/client` | `@farm.js/supabase/client` |
83
+ | `@farm.js/integrations/unkey` | `@farm.js/unkey` |
84
+ | `@farm.js/integrations/utils` | `@farm.js/integration-utils` |
85
+ | `@farm.js/integrations/workos` | `@farm.js/workos` |
86
+ | `@farm.js/integrations/workos/client` | `@farm.js/workos/client` |
87
+
88
+ `@farm.js/stripe/storage` and the `@farm.js/integration-utils` subpaths such as `/config`,
89
+ `/cookies`, and `/webhooks` have no compatibility path. Import them from the dedicated package.
90
+
91
+ ## Package root
92
+
93
+ `@farm.js/integrations` itself re-exports a selected set of values, along with the main input,
94
+ instance, and client types of each package:
95
+
96
+ - `@farm.js/ai`: `aiChatRoute`, `createAIChatRoute`, `defineAIChatRoute`, `aiChatRequestBodySchema`
97
+ - `@farm.js/auth0`: `auth0`, and `auth0Client` from `/client`
98
+ - `@farm.js/authjs`: `authjs`
99
+ - `@farm.js/autumn`: `autumn`, and `autumnClient` from `/client`
100
+ - `@farm.js/better-auth`: `betterAuth`
101
+ - `@farm.js/clerk`: `clerk`
102
+ - `@farm.js/email`: `resend`, `emailSchedule` from `/schedule`, `resendClient` and `template` from
103
+ `/client`
104
+ - `@farm.js/jobs`: `jobs`, `task`, `defineTasks`, `trigger`, `inngest`
105
+ - `@farm.js/polar`: `polar`, and `polarClient` from `/client`
106
+ - `@farm.js/stripe`: `stripe`, `stripeSchema`, `drizzleStorageAdapter`, `prismaStorageAdapter`,
107
+ `sqliteStorageAdapter`, and `stripeClient` from `/client`
108
+ - `@farm.js/supabase`: `supabase`, and `supabaseClient`, `supabaseAuthFormFields` from `/client`
109
+ - `@farm.js/unkey`: `unkey`, `createUnkeyClient`, `UnkeyAPIError`
110
+ - `@farm.js/workos`: `workos`, and `workosClient` from `/client`
111
+
112
+ The `FarmWebhook*` types from `@farm.js/integration-utils/webhooks` are on the root too. Sanity and
113
+ Strapi are not; use their subpaths. The root combines server factories and browser clients in one
114
+ entry point, so browser code should import a client from its `/client` path instead.
115
+
116
+ ## Documentation
117
+
118
+ - [Integrations](https://farmjs.dev/docs/integrations): registering adapters and the dedicated
119
+ packages, with a page per provider.
120
+ - [Reference](https://farmjs.dev/docs/reference): the package and export index.
121
+
122
+ Report issues and find examples in the [Farm.js repository](https://github.com/farming-labs/farm.js).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm.js/integrations",
3
- "version": "0.1.50",
3
+ "version": "0.1.51-beta.1",
4
4
  "description": "Compatibility package that re-exports official Farm.js integrations",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -121,23 +121,23 @@
121
121
  "access": "public"
122
122
  },
123
123
  "dependencies": {
124
- "@farm.js/authjs": "0.1.50",
125
- "@farm.js/autumn": "0.1.50",
126
- "@farm.js/better-auth": "0.1.50",
127
- "@farm.js/auth0": "0.1.50",
128
- "@farm.js/core": "0.1.50",
129
- "@farm.js/integration-utils": "0.1.50",
130
- "@farm.js/jobs": "0.1.50",
131
- "@farm.js/polar": "0.1.50",
132
- "@farm.js/email": "0.1.50",
133
- "@farm.js/ai": "0.1.50",
134
- "@farm.js/strapi": "0.1.50",
135
- "@farm.js/sanity": "0.1.50",
136
- "@farm.js/clerk": "0.1.50",
137
- "@farm.js/unkey": "0.1.50",
138
- "@farm.js/supabase": "0.1.50",
139
- "@farm.js/stripe": "0.1.50",
140
- "@farm.js/workos": "0.1.50"
124
+ "@farm.js/autumn": "0.1.51-beta.1",
125
+ "@farm.js/ai": "0.1.51-beta.1",
126
+ "@farm.js/authjs": "0.1.51-beta.1",
127
+ "@farm.js/core": "0.1.51-beta.1",
128
+ "@farm.js/integration-utils": "0.1.51-beta.1",
129
+ "@farm.js/jobs": "0.1.51-beta.1",
130
+ "@farm.js/polar": "0.1.51-beta.1",
131
+ "@farm.js/sanity": "0.1.51-beta.1",
132
+ "@farm.js/strapi": "0.1.51-beta.1",
133
+ "@farm.js/stripe": "0.1.51-beta.1",
134
+ "@farm.js/unkey": "0.1.51-beta.1",
135
+ "@farm.js/supabase": "0.1.51-beta.1",
136
+ "@farm.js/workos": "0.1.51-beta.1",
137
+ "@farm.js/email": "0.1.51-beta.1",
138
+ "@farm.js/auth0": "0.1.51-beta.1",
139
+ "@farm.js/clerk": "0.1.51-beta.1",
140
+ "@farm.js/better-auth": "0.1.51-beta.1"
141
141
  },
142
142
  "scripts": {
143
143
  "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc",