Skip to content

Commit

Permalink
docs: Update upgrade guide
Browse files Browse the repository at this point in the history
  • Loading branch information
bengourley committed Mar 5, 2020
1 parent 1e7191c commit 30de0c0
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ Many options have been renamed, reworked or replaced.
+ onBreadcrumb: (breadcrumb) => {
+ // a callback to run each time a breadcrumb is created
+ }

// plugins must now be supplied in config rather than via client.use()
+ plugins: []
}
```

Expand Down Expand Up @@ -364,6 +367,45 @@ Previously it was valid to supply a `notify` endpoint without supplying a `sessi
}
```

## Plugins

Plugins must now be supplied in configuration, and the `client.use()` method has been removed. For users of the following plugins, some changes are required:

### `@bugsnag/plugin-react`

```diff
- import bugsnagReact from '@bugsnag/plugin-react'
+ import BugsnagPluginReact from '@bugsnag/plugin-react'

- const bugsnagClient = bugsnag('YOUR_API_KEY')
+ Bugsnag.start({ apiKey: 'YOUR_API_KEY', plugins: [new BugsnagPluginReact(React)] })

- bugsnagClient.use(bugsnagReact, React)
```

### `@bugsnag/plugin-vue`

```diff
- import bugsnagVue from '@bugsnag/plugin-vue'
+ import BugsnagPluginVue from '@bugsnag/plugin-vue'

- const bugsnagClient = bugsnag('YOUR_API_KEY')
+ Bugsnag.start({ apiKey: 'YOUR_API_KEY', plugins: [new BugsnagPluginVue(Vue)] })

- bugsnagClient.use(bugsnagVue, Vue)
```

### `@bugsnag/plugin-{restify|koa|express}`

Since these plugins don't need any input, their usage is simpler and follows this pattern

```diff
- bugsnagClient.use(plugin)
+ Bugsnag.start({
+ plugins: [plugin]
+ })
```

---

See the [full documentation](https://docs.bugsnag.com/platforms/javascript) for more information.
Expand Down

0 comments on commit 30de0c0

Please sign in to comment.