You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/creating-a-new-sdk.md
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -144,3 +144,34 @@ provide an abstraction layer of options that we expose on top of that.
144
144
We generally want to support Node runtimes for the server. However, sometimes there may be alternate runtimes that may
145
145
be supported, e.g. Cloudflare Workers or Vercel Edge Functions. We generally do not need to support these in an MVP, but
146
146
may decide to support them later.
147
+
148
+
#### Cloudflare Workers/Pages
149
+
150
+
To add support for Cloudflare Workers or Pages in a specific SDK, you need to do the following:
151
+
152
+
1. Add `@sentry/cloudflare` as an optional peer dependency to the `package.json` of the SDK.
153
+
This ensures that users who want to use the SDK with Cloudflare will install the necessary package, but it won't be a requirement for users on other platforms.
154
+
155
+
```json
156
+
"peerDependencies": {
157
+
"@sentry/cloudflare": ">=9.33.0"
158
+
},
159
+
"peerDependenciesMeta": {
160
+
"@sentry/cloudflare": {
161
+
"optional": true
162
+
}
163
+
}
164
+
```
165
+
166
+
2. Add `@sentry/cloudflare` to the `devDependencies` in the SDK's `package.json`.
167
+
This is necessary for local development and testing, allowing you to use the Cloudflare-specific APIs in the development environment.
168
+
169
+
```json
170
+
"devDependencies": {
171
+
"@sentry/cloudflare": "9.33.0",
172
+
}
173
+
```
174
+
175
+
3. Add documentation to the [Cloudflare Frameworks docs](https://docs.sentry.io/platforms/javascript/guides/cloudflare/frameworks/) explaining how to set up the SDK for Cloudflare Workers/Pages.
176
+
This documentation should include instructions for users to add the `@sentry/cloudflare` package to their project.
177
+
You can then link from the framework-specific docs pages to the Cloudflare SDK docs page by adding an entry to "Next Steps" on the "Getting Started" and "Manual Setup" pages.
0 commit comments