Skip to content

Commit 06aa5b0

Browse files
committed
Updated README.md and fixed broken badges
1 parent bf0c8d2 commit 06aa5b0

File tree

1 file changed

+67
-5
lines changed

1 file changed

+67
-5
lines changed

README.md

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</p>
1010

1111
![Build Status](https://github.com/rollbar/rollbar.js/workflows/Rollbar.js%20CI/badge.svg?tag=latest)
12-
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/rollbar/rollbar.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rollbar/rollbar.js/context:javascript)
13-
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/rollbar/rollbar.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rollbar/rollbar.js/alerts)
12+
[![npm version](https://img.shields.io/npm/v/rollbar.svg)](https://www.npmjs.com/package/rollbar)
13+
[![npm downloads](https://img.shields.io/npm/dm/rollbar.svg)](https://www.npmjs.com/package/rollbar)
1414

1515
---
1616

@@ -27,10 +27,71 @@
2727
1. [Sign up for a Rollbar account](https://rollbar.com/signup).
2828
2. For client-side Javascript, follow the [Browser Quick Start](https://docs.rollbar.com/docs/javascript#section-quick-start-browser) instructions. For Node.js, follow the [Server Quick Start](https://docs.rollbar.com/docs/javascript#section-quick-start-server).
2929

30+
## Installation
31+
32+
Using npm:
33+
```bash
34+
npm install --save rollbar
35+
```
36+
37+
Using yarn:
38+
```bash
39+
yarn add rollbar
40+
```
41+
42+
Using CDN:
43+
```html
44+
<script src="https://cdn.rollbar.com/rollbarjs/refs/tags/vVERSION/rollbar.min.js"></script>
45+
```
46+
47+
## Quick Start
48+
49+
### Browser
50+
```javascript
51+
import Rollbar from 'rollbar';
52+
53+
const rollbar = new Rollbar({
54+
accessToken: 'YOUR_ACCESS_TOKEN',
55+
captureUncaught: true,
56+
captureUnhandledRejections: true,
57+
environment: 'production'
58+
});
59+
60+
rollbar.info('Hello world!');
61+
```
62+
63+
### Node.js
64+
```javascript
65+
const Rollbar = require('rollbar');
66+
67+
const rollbar = new Rollbar({
68+
accessToken: 'YOUR_ACCESS_TOKEN',
69+
environment: 'production'
70+
});
71+
72+
rollbar.info('Hello world!');
73+
```
74+
75+
### Script Tag
76+
```html
77+
<script>
78+
var _rollbarConfig = {
79+
accessToken: "YOUR_ACCESS_TOKEN",
80+
captureUncaught: true,
81+
captureUnhandledRejections: true
82+
};
83+
</script>
84+
<script src="https://cdn.rollbar.com/rollbarjs/refs/tags/vVERSION/rollbar.min.js"></script>
85+
```
86+
3087
## Usage and Reference
3188

3289
For complete usage instructions and configuration reference, see our [Javascript SDK docs](https://docs.rollbar.com/docs/javascript).
3390

91+
### Examples
92+
93+
See the [examples directory](./examples/) for detailed integration examples with various frameworks and build tools including React, Angular, Vue.js, Next.js, and more.
94+
3495
## Release History & Changelog
3596

3697
See our [Releases](https://github.com/rollbar/rollbar.js/releases) page for a list of all releases, including changes.
@@ -45,10 +106,11 @@ For bug reports, please [open an issue on GitHub](https://github.com/rollbar/rol
45106

46107
To set up a development environment, you'll need Node.js and npm.
47108

48-
2. `npm install -D`
49-
3. `make`
109+
1. Clone the repository: `git clone https://github.com/rollbar/rollbar.js.git`
110+
2. Install dependencies: `npm install`
111+
3. Build: `npm run build`
50112

51-
To run the tests, run `make test`.
113+
To run the tests: `npm test`
52114

53115
## Contributing
54116

0 commit comments

Comments
 (0)