Skip to content

Commit 82c3c6a

Browse files
Update tsdoc
1 parent 903cd87 commit 82c3c6a

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

packages/rum-core/src/boot/rumPublicApi.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,29 @@ export interface RumPublicApi extends PublicApi {
174174
addAction: (name: string, context?: object) => void
175175

176176
/**
177-
* [Experimental] Start an action, stored in `@action`
177+
* Start tracking a custom action.
178+
*
179+
* Call {@link stopAction} with the same name (and optional `actionKey`) to send a RUM action event
180+
* with the elapsed duration. Errors and resources triggered between start and stop are associated
181+
* with the action.
178182
*
179183
* @category Data Collection
180184
* @param name - Name of the action
181185
* @param options - Options of the action (@default type: 'custom')
186+
* @example
187+
* ```ts
188+
* datadogRum.startAction('checkout', { context: { cartId: 'abc' } })
189+
* // ... user completes checkout
190+
* datadogRum.stopAction('checkout')
191+
* ```
182192
*/
183193
startAction: (name: string, options?: ActionOptions) => void
184194

185195
/**
186-
* [Experimental] Stop an action, stored in `@action`
196+
* Stop tracking a custom action started with {@link startAction}.
197+
*
198+
* Sends a RUM action event with the elapsed duration since the matching start call. Context from
199+
* start and stop calls is merged into the event.
187200
*
188201
* @category Data Collection
189202
* @param name - Name of the action
@@ -192,16 +205,28 @@ export interface RumPublicApi extends PublicApi {
192205
stopAction: (name: string, options?: ActionOptions) => void
193206

194207
/**
195-
* [Experimental] Start tracking a resource, stored in `@resource`
208+
* Start tracking a resource manually.
209+
*
210+
* Use this for network activity that the SDK cannot automatically instrument. Call {@link stopResource}
211+
* with the same URL (and optional `resourceKey`) to send a RUM resource event with the elapsed duration.
196212
*
197213
* @category Data Collection
198214
* @param url - URL of the resource
199215
* @param options - Options of the resource (@default type: 'other')
216+
* @example
217+
* ```ts
218+
* datadogRum.startResource('https://api.example.com/users', { type: 'fetch', method: 'POST' })
219+
* // ... perform the request
220+
* datadogRum.stopResource('https://api.example.com/users', { statusCode: 201 })
221+
* ```
200222
*/
201223
startResource: (url: string, options?: ResourceOptions) => void
202224

203225
/**
204-
* [Experimental] Stop tracking a resource, stored in `@resource`
226+
* Stop tracking a resource started with {@link startResource}.
227+
*
228+
* Sends a RUM resource event with the elapsed duration since the matching start call. Context from
229+
* start and stop calls is merged into the event.
205230
*
206231
* @category Data Collection
207232
* @param url - URL of the resource

0 commit comments

Comments
 (0)