-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
137 additions
and
12 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
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 |
---|---|---|
@@ -1,26 +1,77 @@ | ||
--- | ||
title: Setup Spotlight for Astro | ||
title: Using Spotlight with Astro | ||
description: A guide how to setup Spotlight for Astro | ||
--- | ||
|
||
## Install Sentry | ||
|
||
To install Spotlight for Astro call: | ||
|
||
import { Tabs, TabItem } from '@astrojs/starlight/components'; | ||
|
||
<Tabs> | ||
<TabItem label="npm"> | ||
```sh | ||
npx astro add @spotlightjs/core | ||
npx astro add @sentry/astro | ||
``` | ||
</TabItem> | ||
<TabItem label="pnpm"> | ||
```sh | ||
pnpm astro add @spotlightjs/core | ||
pnpm astro add @sentry/astro | ||
``` | ||
</TabItem> | ||
<TabItem label="yarn"> | ||
```sh | ||
yarn astro add @spotlightjs/core | ||
yarn astro add @sentry/astro | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
|
||
After that, Astro should add the Spotlight integration to your `astro.config.mjs` file and should look something like this. | ||
|
||
```js | ||
import { defineConfig } from 'astro/config'; | ||
import sentry from "@sentry/astro"; | ||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [sentry()] | ||
}); | ||
``` | ||
## Install Spotlight | ||
To install Spotlight for Astro call: | ||
<Tabs> | ||
<TabItem label="npm"> | ||
```sh | ||
npx astro add @spotlightjs/astro | ||
``` | ||
</TabItem> | ||
<TabItem label="pnpm"> | ||
```sh | ||
pnpm astro add @spotlightjs/astro | ||
``` | ||
</TabItem> | ||
<TabItem label="yarn"> | ||
```sh | ||
yarn astro add @spotlightjs/astro | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
After that, Astro should add the Spotlight integration to your `astro.config.mjs` file and should look something like this. | ||
```js | ||
import { defineConfig } from 'astro/config'; | ||
import sentry from "@sentry/astro"; | ||
import spotlightjs from "@spotlightjs/astro"; | ||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [sentry(), spotlightjs()] | ||
}); | ||
``` |
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 |
---|---|---|
@@ -1,6 +1,78 @@ | ||
--- | ||
title: Using Spotlight with your Framework | ||
description: A guide how to setup Spotlight for Astro | ||
title: Using Spotlight in your Environment | ||
description: A guide how to setup Spotlight in your environment | ||
--- | ||
|
||
Spotlight can be used with a variety of frameworks and even in your custom environment. | ||
Spotlight can be used with a variety of frameworks and even in your custom environment. See other guides like [Astro](/setup/astro/) if you want to use Spotlight with a specific framework. | ||
|
||
|
||
While it's not dependent on Sentry's SDKs it's recommended to use them to get the most out of Spotlight. | ||
|
||
## Frontend | ||
|
||
### Install | ||
|
||
import { Tabs, TabItem } from '@astrojs/starlight/components'; | ||
|
||
<Tabs> | ||
<TabItem label="npm"> | ||
```sh | ||
npm add --save-dev @spotlightjs/core | ||
``` | ||
</TabItem> | ||
<TabItem label="pnpm"> | ||
```sh | ||
pnpm add -D @spotlightjs/core | ||
``` | ||
</TabItem> | ||
<TabItem label="yarn"> | ||
```sh | ||
yarn add @spotlightjs/core -D | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Setup | ||
|
||
```js | ||
import * as Spotlight from '@spotlightjs/core'; | ||
Spotlight.init(); | ||
``` | ||
|
||
--- | ||
|
||
|
||
## Backend | ||
|
||
If you run Sentry also on your backend you need to tell the SDK to connect to Spotlight. | ||
|
||
### Install | ||
|
||
<Tabs> | ||
<TabItem label="npm"> | ||
```sh | ||
npm add --save-dev @spotlightjs/sidecar | ||
``` | ||
</TabItem> | ||
<TabItem label="pnpm"> | ||
```sh | ||
pnpm add -D @spotlightjs/sidecar | ||
``` | ||
</TabItem> | ||
<TabItem label="yarn"> | ||
```sh | ||
yarn add @spotlightjs/sidecar -D | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Setup | ||
|
||
```js | ||
import * as Sentry from '@sentry/node'; | ||
import { connect } from '@spotlightjs/sidecar/connect' | ||
// .... | ||
Sentry.init({...}); | ||
connect(Sentry.getCurrentHub()); // call connect right after Sentry.init | ||
``` |