Skip to content

Commit 0ff4389

Browse files
committed
add docs
1 parent d1eb93c commit 0ff4389

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

packages/browser/src/core/analytics/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,24 @@ export class Analytics
256256
})
257257
}
258258

259+
/**
260+
*
261+
* @param args - `[category], [name], [properties], [options], [callback]`
262+
* @example
263+
* ```ts
264+
* analytics.page('My Category', 'Pricing', {
265+
* title: 'My Overridden Title',
266+
* myExtraProp: 'foo'
267+
* })
268+
*
269+
* analytics.page('Pricing', {
270+
* title: 'My Overridden Title',
271+
* myExtraProp: 'foo'
272+
* });
273+
*
274+
* ```
275+
* @link https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page
276+
*/
259277
async page(...args: PageParams): Promise<DispatchedEvent> {
260278
const pageCtx = popPageContext(args)
261279
const [category, page, properties, options, callback] =

packages/browser/src/core/buffer/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,24 @@ export class AnalyticsBuffered
354354
ready = this._createMethod('ready')
355355
alias = this._createMethod('alias')
356356
debug = this._createChainableMethod('debug')
357+
/**
358+
*
359+
* @param args - `[category], [name], [properties], [options], [callback]`
360+
* @example
361+
* ```ts
362+
* analytics.page('My Category', 'Pricing', {
363+
* title: 'My Overridden Title',
364+
* myExtraProp: 'foo'
365+
* })
366+
*
367+
* analytics.page('Pricing', {
368+
* title: 'My Overridden Title',
369+
* myExtraProp: 'foo'
370+
* });
371+
*
372+
* ```
373+
* @link https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page
374+
*/
357375
page = this._createMethod('page')
358376
once = this._createChainableMethod('once')
359377
off = this._createChainableMethod('off')

0 commit comments

Comments
 (0)