Skip to content

Commit 104bf5a

Browse files
authored
ref(website): Revise "About Spotlight" pieces (#760)
Refs #561 Also adds a glow animation to the Spotlight trigger button until it is opened once.
1 parent d0315bc commit 104bf5a

File tree

4 files changed

+78
-43
lines changed

4 files changed

+78
-43
lines changed

packages/website/src/components/Hero.astro

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ import ButtonLink from './ButtonLink.astro';
8181
</style>
8282

8383
<div class="wrapper">
84-
<h1 class="neon-header">Sentry for Development</h1>
85-
<div class="sub-heading mb-4">Spotlight is a highly customizable debug tool embedded in your web app.</div>
84+
<h1 class="neon-header">Debuggability Elevated</h1>
85+
<div class="sub-heading mb-4">Spotlight is a debugging tool that can be embedded in your web app</div>
8686
<div class="flex flex-col items-center justify-center gap-2 py-4 mb-4">
87-
<ButtonLink href="/about/">Get Started</ButtonLink>
87+
<ButtonLink href="/about/">Learn More</ButtonLink> or
88+
<button class="inline-flex items-center justify-center px-2 py-2 mx-2 text-base text-s text-white bg-gray-800 border border-transparent rounded-md hover:bg-gray-700 cursor-pointer"
89+
onclick="Spotlight.openSpotlight()">See It in Action</button>
8890
</div>
89-
<img src="/images/trace.png" alt="Spotlight Hero" class="hero-image" />
9091
</div>

packages/website/src/components/LandingPage.astro

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,34 @@ import { Content as CodeBlock } from './codeblock.mdx';
6767

6868
<DocsCta />
6969
<Footer />
70+
<script is:inline>
71+
(function spotlightGlow() {
72+
const host = document.querySelector('#sentry-spotlight-root');
73+
if (!host) {
74+
setTimeout(spotlightGlow, 500);
75+
return;
76+
}
77+
const sheet = new CSSStyleSheet();
78+
sheet.replaceSync( `
79+
.shadow-pulse {
80+
animation: pulse 4s 10;
81+
}
82+
@keyframes pulse {
83+
0% {
84+
box-shadow: 0 0 0 0 rgba(0,0,0,0);
85+
}
86+
40% {
87+
box-shadow: 0 0 105px 35px rgba(79, 70, 229, 1);
88+
}
89+
100% {
90+
box-shadow: 0 0 0 0 rgba(0,0,0,0);
91+
}
92+
`)
93+
host.shadowRoot.adoptedStyleSheets.push(sheet);
94+
const trigger = host.shadowRoot.querySelector('#spotlight-overlay-trigger');
95+
Spotlight.onOpen(() => {
96+
trigger.classList.remove('shadow-pulse');
97+
});
98+
trigger.classList.add('shadow-pulse');
99+
})();
100+
</script>

packages/website/src/content/docs/about.mdx

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,26 @@ Spotlight started out as a [Hackweek project](https://syntax.fm/show/666/hackwee
1313
> Spotlight is Sentry for Development. Inspired by an old project, Django Debug Toolbar, Spotlight brings a rich debug
1414
overlay into development environments, and it does it by leveraging the existing power of Sentry's SDKs.
1515

16-
One of the great benefits of this approach is you get the power of Sentry's telemetry without needing to utilize Sentry's production monitoring. To added benefit, if you do decide you need production monitoring, you can simply configure the already-present SDKs with an upstream API key and you're off to the races!
16+
You get the power of Sentry's telemetry (through its SDKs) without needing Sentry's production monitoring. If you already use Sentry, that's great. All you need is enabling Spotlight in your SDK and run Spotlight. If you are not using Sentry, you need to install the free and open source Sentry SDKs to get started. If you want to use Sentry later on, this saves you the initial setup. Just add your Sentry DSNs into your projects and off you go!
1717

18-
At a high level, Spotlight consists of two components:
18+
Spotlight can show you errors, traces (including distributed traces), profiling data, configurations settings, installed dependencies, you name it. Spotlight is developed with customizablity in mind, so you can add your own integrations to it.
19+
The main differences between Spotlight and Sentry are:
1920

20-
1. An overlay (`@spotlightjs/overlay`) that renders inside of your application. The overlay is a simple React application, and can
21-
seamlessly run in any web application (or even independently!).
21+
1. Spotlight runs locally on your system
22+
2. Spotlight shows you everything and in realtime whereas Sentry is all about aggregation
23+
3. Spotlight is completely free and open source, whereas Sentry is a commercial product (with a free tier and self-hosting options)
2224

23-
2. A proxy server (`@spotlightjs/sidecar`) which enables push-based communication to the overlay. This is achieved via a simple HTTP relay,
24-
allowing SDKs to push events to it, and allowing the overlay to receive events using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
25+
## Quick Start
2526

26-
For convenience, these packages are combined in a single package (`@spotlightjs/spotlight`), which is the recommended way to use Spotlight.
27-
This means that adoption in most projects is as simple as adding a single dependency:
27+
If you are already using Sentry SDKs in your application try the following:
2828

29-
```shell
30-
npm add @spotlightjs/spotlight
31-
```
29+
1. Set `SENTRY_SPOTLIGHT=1` in your env[^1]
30+
2. Run `npx @spotlightjs/spotlight`[^2]
31+
3. Run your application
32+
4. Go to [http://localhost:8969](http://localhost:8969)
33+
5. Observe the traces and errors coming to your local Spotlight instance
3234

33-
Registering Spotlight in your frontend application:
34-
35-
```typescript
36-
import * as Spotlight from '@spotlightjs/spotlight';
37-
38-
// only load Spotlight in dev
39-
if (process.env.NODE_ENV === "development") {
40-
Spotlight.init();
41-
}
42-
```
43-
44-
Running the sidecar in the background:
45-
46-
```shell
47-
npx @spotlightjs/spotlight
48-
```
49-
50-
The overlay itself behaves a little differently from Sentry. That's intentional both because this is for local
51-
development, but also because the project is completely independent of Sentry (other than our guaranteed support).
52-
53-
Alternatively, we provide an Electron-based application that can be used to run the Sidecar as well as a dedicated instance of the overlay. There are some limitations to this method, but it is particularly useful [for headless or mobile environments](/setup/headless/).
54-
55-
<DownloadButton>Download for Mac</DownloadButton>
35+
---
5636

57-
Spotlight can show you errors, traces, configurations settings, installed dependencies, you name it. Spotlight is developed with customizablity in mind, so you can add your own integrations to it.
37+
[^1]: Currently Python, Ruby, PHP, and all JS-based SDKs support this env variable. If your choice of SDK doesn't support it, you can still use Spotlight by enabling the `spotlight` option in its init configuration. Also you can let us know of your interest and we'll add support for the env variable.
38+
[^2]: If you don't have `npx` around, you can use `docker run -p 8969 ghcr.io/getsentry/spotlight:latest`, or head over to our [GitHub Releases page](https://github.com/getsentry/spotlight/releases/latest) and download a binary for your system. Alternatively, we provide an Electron-based application that can be used to run the Sidecar as well as a dedicated instance of the overlay. There are some limitations to this method, but it is particularly useful [for headless or mobile environments](/setup/headless/). <DownloadButton>Download for Mac</DownloadButton>

packages/website/src/content/docs/architecture.mdx

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,41 @@ title: Architecture of Spotlight
33
---
44
import { LinkCard } from '@astrojs/starlight/components';
55

6-
import Architecture from "../../../public/images/architecture.png";
6+
import Architecture from "../../../public/images/architecture.png";
77

88
<img src={Architecture.src} width="80%" alt="Spotlight Architecture" />
99

1010
### Description
1111

12-
Spotlight consists of 2 main components. The UI that is embedded in your Website.
13-
And a Sidecar (Proxy) that streams incoming events to the UI.
12+
At a high level, Spotlight consists of two components:
13+
14+
1. An overlay (`@spotlightjs/overlay`) that renders inside of your application. The overlay is a simple React application, and can
15+
seamlessly run in any web application (or even independently!).
16+
17+
2. A proxy server (`@spotlightjs/sidecar`) which enables push-based communication to the overlay. This is achieved via a simple HTTP relay,
18+
allowing SDKs to push events to it, and allowing the overlay to receive events using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
19+
20+
For convenience, these packages are combined in a single package (`@spotlightjs/spotlight`), which is the recommended way to use Spotlight.
21+
This means that adoption in most projects is as simple as adding a single dependency:
22+
23+
```shell
24+
npm add @spotlightjs/spotlight
25+
```
26+
27+
Registering Spotlight in your frontend application:
28+
29+
```typescript
30+
import * as Spotlight from '@spotlightjs/spotlight';
31+
32+
// only load Spotlight in dev
33+
if (process.env.NODE_ENV === "development") {
34+
Spotlight.init();
35+
}
36+
```
1437

1538
You can send any kind of events to the Sidecar, it forwards it to Spotlight and the integrations within Spotlight need to understand what to do with it.
1639

1740
<LinkCard title="Sidecar" description="Understand what the sidecar does" href="/sidecar/" />
1841

1942
Spotlight by default has a Sentry integration, if you are using a Sentry SDK and enable the Spotlight connection (only required on the Server), Spotlight is able
2043
to render Traces/Errors and more in your frontend.
21-

0 commit comments

Comments
 (0)