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: README.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Here's an introductory video:
16
16
17
17
1. You need a [Google Cloud project](https://console.cloud.google.com).
18
18
1.[Enable the Stackdriver Error Reporting API](https://console.cloud.google.com/apis/api/clouderrorreporting.googleapis.com/overview) for your project. We highly recommend to restrict the usage of the key to your website URL only using an 'HTTP referrer' restriction.
19
-
1. Create a browser API key: Follow [these instructions](https://support.google.com/cloud/answer/6158862) to get an API key for your project.
19
+
1. Create a browser API key: Follow [these instructions](https://support.google.com/cloud/answer/6158862) to get an API key for your project. If this is not an option for your team, you can [use a custom url](#configuring-without-an-api-key) to send your errors to.
20
20
21
21
## Quickstart
22
22
@@ -132,10 +132,25 @@ If you wish, you can manually delegate exceptions, e.g. `try { ... } catch(e) {
132
132
133
133
## Setup for ReactJS
134
134
135
-
Follow the general instructions denoted in _Setup for JavaScript_ to load and initialize the library.
135
+
Follow the general instructions denoted in _Setup for JavaScript_ to load and initialize the library.
136
136
137
137
There is nothing specific that needs to be done with React, other than making sure to initialize the library in your root entry point(typically `index.js`).
138
138
139
+
## Configuring without an API key
140
+
141
+
If you are in a situation where an API key is not an option but you already have an acceptable way to communicate with the Stackdriver API (e.g., a secure back end service running in App Engine), you can configure the endpoint that errors are sent to with the following:
142
+
143
+
```javascript
144
+
consterrorHandler=newStackdriverErrorReporter();
145
+
errorHandler.start({
146
+
targetUrl:'<my-custom-url>',
147
+
service:'<my-service>', // (optional)
148
+
version:'<my-service-version>'// (optional)
149
+
});
150
+
```
151
+
152
+
where `targetUrl` is the url you'd like to send errors to and can be relative or absolute. This endpoint will need to support the [Report API endpoint](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.events/report).
153
+
139
154
## Best Practices
140
155
141
156
### Only reporting in the production environment with Webpack
@@ -168,7 +183,7 @@ if (environment === 'production') {
0 commit comments