Skip to content

Commit 9d6b9fa

Browse files
committed
Merge pull request #390 from getsentry/transport-config
Add documentation for new `transport` config option
2 parents a756ce4 + 60290de commit 9d6b9fa

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

docs/config.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,54 @@ Optional settings
154154
By default, raven truncates messages to a max length of 100
155155
characters. You can customize the max length with this parameter.
156156

157+
.. describe:: transport
158+
159+
Override the default HTTP data transport handler.
160+
161+
Alternatively, can be specified using ``Raven.setTransport(myTransportFunction)``.
162+
163+
.. code-block:: javascript
164+
165+
{
166+
transport: function (options) {
167+
// send data
168+
}
169+
}
170+
171+
The provided function receives a single argument, ``options``, with the following properties:
172+
173+
url
174+
The target url where the data is sent.
175+
176+
data
177+
The outbound exception data.
178+
179+
For POST requests, this should be JSON-encoded and set as the
180+
HTTP body (and transferred as Content-type: application/json).
181+
182+
For GET requests, this should be JSON-encoded and passed over the
183+
query string with key ``sentry_data``.
184+
185+
auth
186+
An object representing authentication data. This should be converted to urlencoded key/value pairs
187+
and passed as part of the query string, for both GET and POST requests.
188+
189+
The auth object has the following properties:
190+
191+
sentry_version
192+
The API version of the Sentry server.
193+
sentry_client
194+
The name and version of the Sentry client of the form ``client/version``.
195+
In this case, ``raven-js/${Raven.VERSION}``.
196+
sentry_key
197+
Your public client key (DSN).
198+
199+
onSuccess
200+
Callback to be invoked upon a successful request.
201+
202+
onFailure
203+
Callback to be invoked upon a failed request.
204+
157205
Putting it all together
158206
-----------------------
159207

0 commit comments

Comments
 (0)