generated from NiGhTTraX/ts-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from bharathvaj-ganesan/develop
Release Raygun
- Loading branch information
Showing
15 changed files
with
252 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@bharathvaj/fullstory-raygun": major | ||
--- | ||
|
||
Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@bharathvaj/fullstory-trackjs": minor | ||
--- | ||
|
||
Fixes - Current FS url at run time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# fullstory-raygun | ||
|
||
The FullStory-raygun integration seamlessly integrates the FullStorys and raygun platforms. When you look at a browser error in raygun, you will see a link to | ||
the FullStory session replay at that exact moment in time under meta data section. When you are watching a FullStory replay and your user experiences an error, | ||
you will see a custom error with the basic error details and link to raygun meta data. | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
**Table of content** | ||
|
||
- [Pre-Requisites](#pre-requisites) | ||
- [Installation](#installation) | ||
- [Setup](#setup) | ||
- [Code Changes](#code-changes) | ||
- [Options](#options) | ||
- [Roadmap](#roadmap) | ||
- [How it works](#how-it-works) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## Pre-Requisites | ||
|
||
For the FullStory-raygun integration to work, you must have the [FullStory browser SDK package](https://www.npmjs.com/package/@fullstory/browser) and the | ||
[Raygun browser SDK package](https://www.npmjs.com/package/raygun4js). | ||
|
||
## Installation | ||
|
||
To install the stable version: | ||
|
||
with npm: | ||
|
||
``` | ||
npm install --save @bharathvaj/fullstory-raygun | ||
``` | ||
|
||
with yarn: | ||
|
||
``` | ||
yarn add @bharathvaj/fullstory-raygun | ||
``` | ||
|
||
## Setup | ||
|
||
### Code Changes | ||
|
||
To set up the integration, both FullStory and raygun need to be initialized. Please add the following code: | ||
|
||
```js | ||
import rg4js from 'raygun4js'; | ||
import * as FullStory from '@fullstory/browser'; | ||
import RaygunFullStory from '@bharathvaj/fullstory-raygun'; | ||
|
||
FullStory.init({ orgId: '__FULLSTORY_ORG_ID__' }); | ||
|
||
rg4js('enableCrashReporting', true); | ||
rg4js('apiKey', '__YOUR_API_KEY__'); | ||
|
||
RaygunFullStory.init(rg4js); | ||
``` | ||
|
||
Replace `__YOUR_API_KEY__` with the API found in Settings > Project Access Tokens. | ||
|
||
You also need to replace `__FULLSTORY_ORG_ID__` with the value of `_fs_org` in the FullStory recording snippet on your | ||
[FullStory settings page](https://help.fullstory.com/hc/en-us/articles/360020623514). | ||
|
||
### Options (Optional) | ||
|
||
You can also customize the error event name in FullStory by | ||
|
||
```js | ||
// ... | ||
RaygunFullStory.init(rg4js, { | ||
fsEventName: 'Custom Error Name', | ||
}); | ||
|
||
//... | ||
``` | ||
|
||
# Roadmap | ||
|
||
[ ] - Support Raygun Error link in FullStory Custom Event. | ||
|
||
[ ] - Add Unit test cases | ||
|
||
## How it works | ||
|
||
In Raygun, you should see additional tab called `FULLSTORY` for the error event which will have `urlAtTime`. | ||
|
||
![Raygun](https://i.imgur.com/XnEyRPv.png) | ||
|
||
In FullStory, you should see an event called `Raygun Error` on the right sidebar. | ||
|
||
![FullStory](https://i.imgur.com/a26RBtf.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "@bharathvaj/fullstory-raygun", | ||
"description": "Fullstory Raygun Integration", | ||
"version": "0.0.0", | ||
"main": "dist/index", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"keywords": [ | ||
"raygun", | ||
"fullstory", | ||
"integration" | ||
], | ||
"scripts": { | ||
"clean": "rimraf -rf ./dist", | ||
"build": "yarn clean && tsc -p tsconfig.build.json", | ||
"prepublishOnly": "yarn run build", | ||
"test": "yarn run build" | ||
}, | ||
"peerDependencies": { | ||
"raygun4js": ">=2.0.0", | ||
"@fullstory/browser": ">=1.0.0" | ||
}, | ||
"devDependencies": { | ||
"raygun4js": "2.22.1", | ||
"@fullstory/browser": "^1.4.9", | ||
"tslib": "^2.2.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"author": "Bharathvaj Ganesan <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/bharathvaj-ganesan/fullstory-integrations/issues" | ||
}, | ||
"homepage": "https://github.com/bharathvaj-ganesan/fullstory-integrations#readme" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as FullStory from '@fullstory/browser'; | ||
import { getOriginalExceptionProperties } from './utils'; | ||
|
||
/** | ||
* This integration creates a link from the Raygun Error to the FullStory replay. | ||
* It also creates a link from the FullStory event to the Raygun error. | ||
*/ | ||
|
||
type Options = { | ||
fsEventName: string; | ||
}; | ||
|
||
class RaygunFullStory { | ||
static init(client, options?: Options) { | ||
|
||
const fsEventName = options?.fsEventName || 'Raygun Error'; | ||
|
||
/** | ||
* Returns Raygun's Error event URL | ||
* @returns string | ||
*/ | ||
const getRaygunUrl = () => `Could not retrieve url`; | ||
|
||
client('withCustomData', () => { | ||
// FS.event is immediately ready even if FullStory isn't fully bootstrapped | ||
FullStory.event(fsEventName, { | ||
raygunUrl: getRaygunUrl(), | ||
...getOriginalExceptionProperties(event) | ||
}); | ||
return { | ||
fullstoryUrl: FullStory.getCurrentSessionURL(true) || 'current session URL API not ready' | ||
} | ||
}); | ||
} | ||
|
||
} | ||
|
||
export default RaygunFullStory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import RaygunFullStory from './RaygunFullStory'; | ||
|
||
export default RaygunFullStory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Checks if the exception has message | ||
* @param exception | ||
* @returns | ||
*/ | ||
const isError = (exception: string | Error): exception is Error => { | ||
return (exception as Error).message !== undefined; | ||
}; | ||
|
||
/** | ||
* Get the message and name properties from the original exception | ||
* @param {Object} event | ||
*/ | ||
export const getOriginalExceptionProperties = (event) => { | ||
if (event && event.originalError && isError(event.originalError)) { | ||
const originalError = event.originalError || {}; | ||
const { name, message } = originalError; | ||
return { name, message }; | ||
} | ||
|
||
return {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.build.json", | ||
|
||
"compilerOptions": { | ||
"outDir": "./dist" | ||
}, | ||
|
||
"include": [ | ||
"src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../tsconfig.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4554,6 +4554,11 @@ quick-lru@^4.0.1: | |
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" | ||
integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== | ||
|
||
[email protected]: | ||
version "2.22.1" | ||
resolved "https://registry.yarnpkg.com/raygun4js/-/raygun4js-2.22.1.tgz#a6920309e5730c9a906795e561ea98f5d0b1a0c1" | ||
integrity sha512-n9pJdC2llFqof28CEQ7JEy1LvzycQq1SvyK59+M1Merzrl/+iW/1uKvQVMfrpv73OEr19deQM7TB3Ue+m7yIFg== | ||
|
||
read-cmd-shim@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9" | ||
|