Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''
---

<!-- Guidelines -->
<!-- Please check if an issue does not exist already for it: https://github.com/DataDog/browser-sdk/issues -->
<!-- Please check if an issue does not exist already for it: https://github.com/flashcatcloud/browser-sdk/issues -->
<!-- Please check if the issue happens with latest version -->

**Describe the bug**
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ labels: enhancement
assignees: ''
---

Please contact [support](https://www.datadoghq.com/support/) to open a feature request.
Please contact [support](https://flashcat.cloud/about/) to open a feature request.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/support-needed.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''
---

<!-- Guidelines -->
<!-- Please check if an issue does not exist already for it: https://github.com/DataDog/browser-sdk/issues -->
<!-- Please check if an issue does not exist already for it: https://github.com/flashcatcloud/browser-sdk/issues -->
<!-- Please check if the issue happens with latest version -->

**What are you trying to achieve and what is your issue? Please describe.**
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

---

I have gone over the [contributing](https://github.com/DataDog/browser-sdk/blob/main/CONTRIBUTING.md) documentation.
I have gone over the [contributing](https://github.com/flashcatcloud/browser-sdk/blob/main/CONTRIBUTING.md) documentation.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ label our Commit messages and Pull Request titles:

👌 - Updating code due to code review changes.

[1]: https://docs.datadoghq.com/help/
[1]: https://flashcat.cloud/contact/
[2]: https://gitmoji.carloscuesta.me/
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Collect and send browser data to Flashcat.

## Getting Started

See the dedicated [Flashcat Browser RUM Collection documentation][18] to learn how to send RUM data from your browser application to Datadog.
See the dedicated [Flashcat Browser RUM Collection documentation][18] to learn how to send RUM data from your browser application to Flashcat.

## npm packages

Expand All @@ -19,6 +19,9 @@ This repository contains several packages:
| browser-worker | [![npm version][61]][62] | [![bundle size][63]][64] |
| browser-core | [![npm version][41]][42] | [![bundle size][43]][44] |

## CDN bundle

https://static.flashcat.cloud/browser-sdk/v0/flashcat-rum.js

## License Information

Expand All @@ -28,7 +31,7 @@ This project is modified and distributed by flashcat under the Apache License 2.

For complete license information, please refer to the [LICENSE](./LICENSE) file.

[18]: https://docs.flashcat.cloud/
[18]: https://docs.flashcat.cloud/zh/flashduty/rum/introduction

[01]: https://badge.fury.io/js/%40flashcatcloud%2Fbrowser-logs.svg
[02]: https://badge.fury.io/js/%40flashcatcloud%2Fbrowser-logs
Expand Down
95 changes: 0 additions & 95 deletions developer-extension/README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,3 @@
# Browser SDK developer extension

Browser extension to investigate your Browser SDK integration.

## Getting started

### From the Chrome Web Store

The extension is available to **Datadog employees** on the [Chrome Web Store](https://chrome.google.com/webstore/detail/datadog-browser-sdk-devel/boceobohkgenpcpogecpjlnmnfbdigda).

### By loading the extension unpacked

The packed extension is not (yet?) published publicly. You will need to clone this repository and
build the extension manually.

```
$ git clone https://github.com/DataDog/browser-sdk
$ cd browser-sdk
$ yarn
$ yarn build
```

Then, in Google Chrome:

- Open the _Extension Management_ page by navigating to [chrome://extensions](chrome://extensions).
- Enable _Developer Mode_ by clicking the toggle switch next to _Developer mode_.
- Click the _LOAD UNPACKED_ button and select the `browser-sdk/developer-extension/dist`
directory.
- Open devtools and the extension features are located on the `Browser SDK` panel.

## Features

- Log events sent by the SDK in the devtools console
- Flush buffered events
- End current session
- Load the SDK development bundles instead of production ones
- Switch between `rum` and `rum-slim` bundles
- Retrieve Logs/RUM configuration

## Browser compatibility

For now, only Google Chrome is supported.

## Usage tips

### Event Tab

The Event Tab contains a list of events sent by the SDK and a menu of event types for quick filtering.

#### Search syntax

We support a basic `key:value` search syntax, which means you can search within the limits of [RUM event structures](https://docs.datadoghq.com/real_user_monitoring/explorer/search/), such as `action.target.name:action_name`.

We split each search key based on whitespace. To search with multiple conditions, simply add whitespace characters in between, such as:

```
type:view application.id:2 action.target.name:my_action_name
```

#### Event columns

The Events List offers an interactive experience to visualize RUM events:

- Drag and drop to reorder columns in the event list
- Remove (by clicking on `x` in the column title) or add new columns:
- Add a new column from searching for a field by clicking on the `+column` icon at the right side of the header row.
- Add a new column from values in existing columns by right clicking on any attribute in the event json.
- Copy queries and objects from the list by clicking on any cell

### Info Tab

**⚠️Don’t forget to reset everything in the Info Tab after experimenting.**

Info tab contains information about Session and RUM SDK configurations

- **RUM/LOGS Configuration**: edit configuration files on the fly. When configuration changes apply, the extension will automatically reload the page. But for some configurations you might want to click on End Current Session to ensure that the changes kicked in.
- **End current session**: manually end the current session within the extension. This will also end the current replay session.

### Setting Tab

> [!IMPORTANT]
> Don’t forget to reset everything in the Setting Tab after experimenting.

- **Request Interception**: override the current SDK bundle with local build, or ​​switch between `rum` and `rum-slim` bundles on any site that is using RUM SDK. (note: if the SDK is installed from NPM, this override might not work, as it is still in an experimental stage.)

- **Debug Mode**: This option enables debug mode from the developer extension to display errors happening in RUM and LOGS in the developer console.

## Contribution tips

To work on the developer extension and debug it easily:

1. In a terminal, cd into the `developer-extension` folder.

2. Run `yarn dev`.

3. In Chrome, load the `developer-extension/dist` folder as an unpacked extension.

4. After you make a change, right-click on the extension UI and “Reload frame”.
6 changes: 2 additions & 4 deletions developer-extension/src/panel/monitoring.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { flashcatRum } from '@flashcatcloud/browser-rum'
import { datadogLogs } from '@flashcatcloud/browser-logs'
import { flashcatLogs } from '@flashcatcloud/browser-logs'
import packageJson from '../../package.json'
import { DEFAULT_PANEL_TAB } from '../common/panelTabConstants'

export function initMonitoring() {
flashcatRum.init({
applicationId: '235202fa-3da1-4aeb-abc4-d01b10ca1539',
clientToken: 'pub74fd472504982beb427b647893758040',
// site: 'flashcat.cloud',
service: 'browser-sdk-developer-extension',
env: 'prod',
version: packageJson.version,
Expand All @@ -24,9 +23,8 @@ export function initMonitoring() {
flashcatRum.startSessionReplayRecording()
flashcatRum.startView(DEFAULT_PANEL_TAB)

datadogLogs.init({
flashcatLogs.init({
clientToken: 'pub74fd472504982beb427b647893758040',
site: 'browser.flashcat.cloud',
service: 'browser-sdk-developer-extension',
env: 'prod',
version: packageJson.version,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `core`

Datadog browser core utilities.
Flashcat browser core utilities.
20 changes: 9 additions & 11 deletions packages/logs/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
# Browser Log Collection

Send logs to Datadog from web browser pages with the browser logs SDK.
Send logs to Flashcat from web browser pages with the browser logs SDK.

See the [dedicated datadog documentation][1] for more details.

## Usage

After adding [`@flashcatcloud/browser-logs`][2] to your `package.json` file, initialize it with:

```javascript
import { datadogLogs } from '@flashcatcloud/browser-logs'
import { flashcatLogs } from '@flashcatcloud/browser-logs'

datadogLogs.init({
clientToken: '<DATADOG_CLIENT_TOKEN>',
site: '<DATADOG_SITE>',
flashcatLogs.init({
clientToken: '<FC_CLIENT_TOKEN>',
site: '<FC_SITE>',
forwardErrorsToLogs: true,
sessionSampleRate: 100,
})
```

After the Datadog browser logs SDK is initialized, send custom log entries directly to Datadog:
After the Flashcat browser logs SDK is initialized, send custom log entries directly to Flashcat:

```javascript
import { datadogLogs } from '@flashcatcloud/browser-logs'
import { flashcatLogs } from '@flashcatcloud/browser-logs'

datadogLogs.logger.info('Button clicked', { name: 'buttonName', id: 123 })
flashcatLogs.logger.info('Button clicked', { name: 'buttonName', id: 123 })

try {
...
throw new Error('Wrong behavior')
...
} catch (ex) {
datadogLogs.logger.error('Error occurred', { team: 'myTeam' }, ex)
flashcatLogs.logger.error('Error occurred', { team: 'myTeam' }, ex)
}
```

<!-- Note: all URLs should be absolute -->

[1]: https://docs.datadoghq.com/logs/log_collection/javascript
[2]: https://www.npmjs.com/package/@flashcatcloud/browser-logs
4 changes: 2 additions & 2 deletions packages/logs/src/entries/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export type { LogsInitConfiguration } from '../domain/configuration'
export type { LogsEvent } from '../logsEvent.types'
export type { LogsEventDomainContext } from '../domainContext.types'

export const datadogLogs = makeLogsPublicApi(startLogs)
export const flashcatLogs = makeLogsPublicApi(startLogs)

interface BrowserWindow extends Window {
FC_LOGS?: LogsPublicApi
}
defineGlobal(getGlobalObject<BrowserWindow>(), 'FC_LOGS', datadogLogs)
defineGlobal(getGlobalObject<BrowserWindow>(), 'FC_LOGS', flashcatLogs)
2 changes: 1 addition & 1 deletion packages/rum-core/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `rum-core`

Datadog browser RUM core utilities.
Flashcat browser RUM core utilities.
6 changes: 3 additions & 3 deletions packages/rum-react/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RUM Browser Monitoring - React integration

This package provides React and React ecosystem integrations for Datadog Browser RUM.
This package provides React and React ecosystem integrations for Flashcat Browser RUM.

## Installation

Expand Down Expand Up @@ -30,7 +30,7 @@ flashcatRum.init({

To track React component rendering errors, use one of the following:

- An `ErrorBoundary` component (see [React documentation][1]) that catches errors and reports them to Datadog.
- An `ErrorBoundary` component (see [React documentation][1]) that catches errors and reports them to Flashcat.
- A function that you can use to report errors from your own `ErrorBoundary` component.

#### `ErrorBoundary` usage
Expand Down Expand Up @@ -80,7 +80,7 @@ class MyErrorBoundary extends React.Component {
- Use the [`useRoutes`][5] hook.
- Use the [`Routes`][6] component.

To track route changes with the Datadog RUM Browser SDK, first initialize the `reactPlugin` with the `router: true` option, then replace those functions with their equivalent from `@flashcatcloud/browser-rum-react/react-router-v6`. Example:
To track route changes with the Flashcat RUM Browser SDK, first initialize the `reactPlugin` with the `router: true` option, then replace those functions with their equivalent from `@flashcatcloud/browser-rum-react/react-router-v6`. Example:

```javascript
import { RouterProvider } from 'react-router-dom'
Expand Down
12 changes: 6 additions & 6 deletions packages/rum/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# RUM Browser Monitoring

Datadog Real User Monitoring (RUM) enables you to visualize and analyze the real-time performance and user journeys of your application's individual users.
Flashcat Real User Monitoring (RUM) enables you to visualize and analyze the real-time performance and user journeys of your application's individual users.

See the [dedicated datadog documentation][1] for more details.
See the [dedicated flashcat documentation][1] for more details.

## Usage

Expand All @@ -12,9 +12,9 @@ To start collecting events, add [`@flashcatcloud/browser-rum`][2] to your `packa
import { flashcatRum } from '@flashcatcloud/browser-rum'

flashcatRum.init({
applicationId: '<DATADOG_APPLICATION_ID>',
clientToken: '<DATADOG_CLIENT_TOKEN>',
site: '<DATADOG_SITE>',
applicationId: '<FC_APPLICATION_ID>',
clientToken: '<FC_CLIENT_TOKEN>',
site: '<FC_SITE>',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
Expand All @@ -30,5 +30,5 @@ flashcatRum.init({

<!-- Note: all URLs should be absolute -->

[1]: https://docs.datadoghq.com/real_user_monitoring/browser
[1]: https://docs.flashcat.cloud/zh/flashduty/rum/introduction
[2]: https://www.npmjs.com/package/@flashcatcloud/browser-rum
2 changes: 1 addition & 1 deletion packages/worker/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `worker`

Datadog browser web Worker.
Flashcat browser web Worker.
4 changes: 2 additions & 2 deletions performances/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

This tool runs various scenarios in a browser and profile the impact of the Browser SDK.

Use `yarn start` to execute it with `datadog-rum.js` and `yarn start --recorder` to use
`datadog-rum-recorder.js`.
Use `yarn start` to execute it with `flashcat-rum.js` and `yarn start --recorder` to use
`flashcat-rum-recorder.js`.
10 changes: 5 additions & 5 deletions test/app/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { datadogLogs } from '@flashcatcloud/browser-logs'
import { datadogRum } from '@flashcatcloud/browser-rum'
import { flashcatLogs } from '@flashcatcloud/browser-logs'
import { flashcatRum } from '@flashcatcloud/browser-rum'

declare global {
interface Window {
Expand All @@ -18,7 +18,7 @@ if (typeof window !== 'undefined') {
}
} else {
// compat test
datadogLogs.init({ clientToken: 'xxx', beforeSend: undefined })
datadogRum.init({ clientToken: 'xxx', applicationId: 'xxx', beforeSend: undefined })
datadogRum.setUser({ id: undefined })
flashcatLogs.init({ clientToken: 'xxx', beforeSend: undefined })
flashcatRum.init({ clientToken: 'xxx', applicationId: 'xxx', beforeSend: undefined })
flashcatRum.setUser({ id: undefined })
}