Skip to content

Commit 80e7035

Browse files
committed
Added Official Agent Skill for client integration.
1 parent 68302ce commit 80e7035

16 files changed

Lines changed: 934 additions & 0 deletions
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: exceptionless-javascript
3+
description: Use this skill when a developer wants to install, configure, troubleshoot, or integrate Exceptionless JavaScript clients for browser, Node.js, React, Vue, AngularJS, Express, Next.js, SvelteKit, or custom runtimes. Use it for API keys, startup, self-hosting, sending errors/logs/feature usage/404/custom events, indexed event properties, sessions, heartbeats, user identity, PII/data exclusions, plugins, runtime client configuration values, queues, and production setup even if they only ask "how do I wire up Exceptionless?"
4+
---
5+
6+
# Exceptionless JavaScript SDK
7+
8+
Use this skill to produce source-accurate setup code, integration guidance, and technical documentation for the Exceptionless JavaScript clients.
9+
10+
Keep answers compact. Prefer pointing to official docs for broad product behavior, and use local package READMEs/source to correct stale snippets or repo-specific package details.
11+
12+
## Official Docs
13+
14+
Primary docs:
15+
16+
- JavaScript overview: https://exceptionless.com/docs/clients/javascript/
17+
- Configuration: https://exceptionless.com/docs/clients/javascript/client-configuration/
18+
- Client configuration values: https://exceptionless.com/docs/clients/javascript/client-configuration-values/
19+
- Sending events: https://exceptionless.com/docs/clients/javascript/sending-events/
20+
- Filtering and indexed data: https://exceptionless.com/docs/filtering-and-searching/
21+
- User sessions: https://exceptionless.com/docs/user-sessions/
22+
- Troubleshooting: https://exceptionless.com/docs/clients/javascript/troubleshooting/
23+
- Self-hosting: https://exceptionless.com/docs/self-hosting/
24+
25+
Framework docs:
26+
27+
- React: https://exceptionless.com/docs/clients/javascript/guides/react/
28+
- Vue: https://exceptionless.com/docs/clients/javascript/guides/vue/
29+
- Angular: https://exceptionless.com/docs/clients/javascript/guides/angular/
30+
- Node: https://exceptionless.com/docs/clients/javascript/node-example/
31+
- Express: https://exceptionless.com/docs/clients/javascript/guides/express/
32+
33+
## Pick References
34+
35+
Read only the reference that matches the user's runtime, then add shared references as needed:
36+
37+
- `@exceptionless/core`: [references/client-core.md](references/client-core.md)
38+
- `@exceptionless/browser`: [references/client-browser.md](references/client-browser.md)
39+
- `@exceptionless/node`: [references/client-node.md](references/client-node.md)
40+
- `@exceptionless/react`: [references/client-react.md](references/client-react.md)
41+
- `@exceptionless/vue`: [references/client-vue.md](references/client-vue.md)
42+
- `@exceptionless/angularjs`: [references/client-angularjs.md](references/client-angularjs.md)
43+
- Sending events: [references/sending-events.md](references/sending-events.md)
44+
- Configuration and client configuration values: [references/configuration.md](references/configuration.md)
45+
- Sessions, heartbeats, and user identity: [references/sessions.md](references/sessions.md)
46+
- Plugins: [references/plugins.md](references/plugins.md)
47+
- Data exclusions and PII: [references/data-exclusions.md](references/data-exclusions.md)
48+
- Troubleshooting: [references/troubleshooting.md](references/troubleshooting.md)
49+
- Self-hosting: [references/self-hosting.md](references/self-hosting.md)
50+
51+
## Rules
52+
53+
- Use `Exceptionless.startup(...)` once during app startup. `startup()` with no args is used later by lifecycle plugins to resume timers/queue processing.
54+
- Use the singleton from the platform package when automatic capture matters. Create `ExceptionlessClient` manually only for custom pipelines or tests.
55+
- `submitException` and `createException` take an `Error`. For unknown caught values, use exported `toError(value)` when available.
56+
- `markAsCritical()` marks the event critical; `markAsCritical(false)` leaves tags unchanged.
57+
- `config.serverUrl` also sets `configServerUrl` and `heartbeatServerUrl`; assign custom endpoint overrides after setting `serverUrl`.
58+
- Use lowercase log levels in new snippets: `"trace"`, `"debug"`, `"info"`, `"warn"`, `"error"`, `"fatal"`, `"off"`.
59+
- For short-lived Node/serverless work, call `await Exceptionless.processQueue()` after critical submissions.
60+
61+
## Integrator Guidance
62+
63+
- Prefer complete, copyable snippets with imports and realistic placeholder values.
64+
- Include only high-level setup/configuration inline; point to official docs for broader product explanation.
65+
- Make privacy controls explicit in production examples that collect request, cookie, header, query, post, or user data. Read [references/data-exclusions.md](references/data-exclusions.md) for PII-sensitive examples.
66+
- Read [references/plugins.md](references/plugins.md) before documenting custom event enrichment, runtime filtering, or cancellation behavior.
67+
- Read [references/sessions.md](references/sessions.md) before documenting sessions, heartbeats, user identity, or session end behavior.
68+
- Explain near real-time client settings with server setting keys only for advanced docs: `@@log:*`, `@@error:*`, `@@usage:*`, `@@404:*`, `@@DataExclusions`, `@@UserAgentBotPatterns`.
69+
- For SSR, hot reload, or serverless examples, memoize startup and flush short-lived server work with `await Exceptionless.processQueue()`.
70+
- Before calling snippets "compiled" or "validated", actually type-check or run a representative compile against the workspace packages.
71+
72+
## Source Anchors
73+
74+
Verify behavior in:
75+
76+
- `packages/core/src/ExceptionlessClient.ts`
77+
- `packages/core/src/configuration/Configuration.ts`
78+
- `packages/core/src/EventBuilder.ts`
79+
- `packages/core/src/plugins/default/EventExclusionPlugin.ts`
80+
- `packages/core/src/submission/DefaultSubmissionClient.ts`
81+
- `packages/browser/src/BrowserExceptionlessClient.ts`
82+
- `packages/node/src/NodeExceptionlessClient.ts`
83+
- Package READMEs and `example/` apps.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Exceptionless JavaScript"
3+
short_description: "Configure Exceptionless JavaScript clients"
4+
default_prompt: "Use $exceptionless-javascript to configure, document, or troubleshoot an Exceptionless JavaScript client."
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# @exceptionless/angularjs
2+
3+
Use for AngularJS 1.x apps. The official public docs currently show generic Angular with `@exceptionless/browser`; this repo also ships an AngularJS package.
4+
5+
Docs: https://exceptionless.com/docs/clients/javascript/guides/angular/
6+
7+
## Install
8+
9+
```bash
10+
npm install @exceptionless/angularjs --save
11+
```
12+
13+
CDN or bundled script:
14+
15+
```html
16+
<script type="module" src="https://unpkg.com/@exceptionless/angularjs"></script>
17+
```
18+
19+
## Configure
20+
21+
```js
22+
import "@exceptionless/angularjs";
23+
24+
angular.module("app", ["exceptionless"]).run([
25+
"$ExceptionlessClient",
26+
async ($ExceptionlessClient) => {
27+
await $ExceptionlessClient.startup((config) => {
28+
config.apiKey = "API_KEY_HERE";
29+
config.defaultTags.push("Example", "JavaScript", "AngularJS");
30+
});
31+
}
32+
]);
33+
```
34+
35+
## Send
36+
37+
```js
38+
angular.module("app").controller("DemoController", [
39+
"$ExceptionlessClient",
40+
function ($ExceptionlessClient) {
41+
this.submit = async function () {
42+
await $ExceptionlessClient.submitLog("angularjs", "Hello world", "info");
43+
await $ExceptionlessClient.submitFeatureUsage("DemoButton");
44+
};
45+
}
46+
]);
47+
```
48+
49+
The AngularJS package decorates `$exceptionHandler` and `$log`, adds an HTTP response-error interceptor, and submits common route/state events.
50+
51+
## Source Anchors
52+
53+
- `packages/angularjs/README.md`
54+
- `packages/angularjs/src/index.ts`
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# @exceptionless/browser
2+
3+
Use for vanilla browser apps, script-tag usage, Vite/browser bundles, and framework integrations that import the browser client directly.
4+
5+
Docs: https://exceptionless.com/docs/clients/javascript/
6+
7+
## Install
8+
9+
```bash
10+
npm install @exceptionless/browser --save
11+
```
12+
13+
CDN:
14+
15+
```html
16+
<script type="module">
17+
import { Exceptionless } from "https://unpkg.com/@exceptionless/browser";
18+
19+
await Exceptionless.startup("API_KEY_HERE");
20+
</script>
21+
```
22+
23+
## Configure
24+
25+
```js
26+
import { Exceptionless } from "@exceptionless/browser";
27+
28+
await Exceptionless.startup((config) => {
29+
config.apiKey = "API_KEY_HERE";
30+
config.version = "1.2.3";
31+
config.setUserIdentity("12345678", "Blake");
32+
config.useSessions();
33+
config.defaultTags.push("Example", "JavaScript", "Browser");
34+
});
35+
```
36+
37+
## Send
38+
39+
```js
40+
import { Exceptionless } from "@exceptionless/browser";
41+
42+
await Exceptionless.startup("API_KEY_HERE");
43+
await Exceptionless.submitLog("browser", "Hello world", "info");
44+
await Exceptionless.submitFeatureUsage("New Shopping Cart Feature");
45+
```
46+
47+
The browser package wires global browser error/rejection capture on first startup. For privacy and self-hosted options, read [configuration.md](configuration.md) and [self-hosting.md](self-hosting.md).
48+
49+
## Source Anchors
50+
51+
- `packages/browser/README.md`
52+
- `packages/browser/src/BrowserExceptionlessClient.ts`
53+
- `packages/browser/src/plugins/BrowserGlobalHandlerPlugin.ts`
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# @exceptionless/core
2+
3+
Use for custom runtimes, tests, or advanced pipelines that do not need browser or Node automatic capture.
4+
5+
Docs: https://exceptionless.com/docs/clients/javascript/
6+
7+
## Install
8+
9+
```bash
10+
npm install @exceptionless/core --save
11+
```
12+
13+
## Configure
14+
15+
```js
16+
import { ExceptionlessClient } from "@exceptionless/core";
17+
18+
const client = new ExceptionlessClient();
19+
20+
await client.startup((config) => {
21+
config.apiKey = "API_KEY_HERE";
22+
config.version = "1.2.3";
23+
config.setUserIdentity("12345678", "Blake");
24+
config.defaultTags.push("Example", "JavaScript", "Core");
25+
config.defaultData["deployment"] = { environment: "production" };
26+
});
27+
```
28+
29+
## Send
30+
31+
```js
32+
import { ExceptionlessClient } from "@exceptionless/core";
33+
34+
const client = new ExceptionlessClient();
35+
await client.startup("API_KEY_HERE");
36+
await client.submitLog("custom-runtime", "Hello world", "info");
37+
await client.submitFeatureUsage("New Shopping Cart Feature");
38+
```
39+
40+
For full event examples, read [sending-events.md](sending-events.md). For all configuration patterns, read [configuration.md](configuration.md).
41+
42+
## Source Anchors
43+
44+
- `packages/core/README.md`
45+
- `packages/core/src/ExceptionlessClient.ts`
46+
- `packages/core/src/configuration/Configuration.ts`
47+
- `packages/core/src/EventBuilder.ts`
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# @exceptionless/node
2+
3+
Use for Node.js scripts, CLIs, workers, Express, Next.js server runtime, SvelteKit server hooks, and serverless functions.
4+
5+
Docs:
6+
7+
- Node: https://exceptionless.com/docs/clients/javascript/node-example/
8+
- Express: https://exceptionless.com/docs/clients/javascript/guides/express/
9+
10+
## Install
11+
12+
```bash
13+
npm install @exceptionless/node --save
14+
```
15+
16+
## Configure
17+
18+
```js
19+
import { Exceptionless } from "@exceptionless/node";
20+
21+
await Exceptionless.startup((config) => {
22+
config.apiKey = process.env.EXCEPTIONLESS_API_KEY ?? "API_KEY_HERE";
23+
config.version = process.env.npm_package_version ?? "0.0.0";
24+
config.defaultTags.push("Example", "JavaScript", "Node");
25+
});
26+
```
27+
28+
## Send
29+
30+
```js
31+
import { Exceptionless } from "@exceptionless/node";
32+
33+
await Exceptionless.startup("API_KEY_HERE");
34+
await Exceptionless.submitLog("node", "Hello world", "info");
35+
await Exceptionless.submitFeatureUsage("WorkerStarted");
36+
```
37+
38+
## Express Sketch
39+
40+
```js
41+
import { Exceptionless, KnownEventDataKeys, toError } from "@exceptionless/node";
42+
import express from "express";
43+
44+
await Exceptionless.startup("API_KEY_HERE");
45+
46+
const app = express();
47+
48+
app.use(async (error, req, res, next) => {
49+
if (res.headersSent) {
50+
next(error);
51+
return;
52+
}
53+
54+
await Exceptionless.createUnhandledException(toError(error), "express")
55+
.setContextProperty(KnownEventDataKeys.RequestInfo, req)
56+
.submit();
57+
58+
res.status(500).send("Something broke");
59+
});
60+
```
61+
62+
For short-lived scripts, route handlers, and serverless work, flush after critical submissions:
63+
64+
```js
65+
import { Exceptionless } from "@exceptionless/node";
66+
67+
await Exceptionless.processQueue();
68+
```
69+
70+
## Source Anchors
71+
72+
- `packages/node/README.md`
73+
- `packages/node/src/NodeExceptionlessClient.ts`
74+
- `packages/node/src/plugins/NodeGlobalHandlerPlugin.ts`
75+
- `packages/node/src/plugins/NodeRequestInfoPlugin.ts`
76+
- `example/express/app.js`
77+
- `example/nextjs/README.md`
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# @exceptionless/react
2+
3+
Use for React web apps. This package re-exports the browser client and adds `ExceptionlessErrorBoundary`.
4+
5+
Docs: https://exceptionless.com/docs/clients/javascript/guides/react/
6+
7+
## Install
8+
9+
```bash
10+
npm install @exceptionless/react --save
11+
```
12+
13+
## Configure
14+
15+
```jsx
16+
import { Component } from "react";
17+
import { Exceptionless, ExceptionlessErrorBoundary } from "@exceptionless/react";
18+
19+
class App extends Component {
20+
async componentDidMount() {
21+
await Exceptionless.startup((config) => {
22+
config.apiKey = "API_KEY_HERE";
23+
config.setUserIdentity("12345678", "Blake");
24+
config.defaultTags.push("Example", "React");
25+
});
26+
}
27+
28+
render() {
29+
return (
30+
<ExceptionlessErrorBoundary>
31+
<div>Application content</div>
32+
</ExceptionlessErrorBoundary>
33+
);
34+
}
35+
}
36+
```
37+
38+
## Send
39+
40+
```js
41+
import { Exceptionless, toError } from "@exceptionless/react";
42+
43+
await Exceptionless.startup("API_KEY_HERE");
44+
45+
try {
46+
throw new Error("Profile save failed");
47+
} catch (error) {
48+
await Exceptionless.submitException(toError(error));
49+
}
50+
51+
await Exceptionless.submitLog("react", "Hello world", "info");
52+
await Exceptionless.submitFeatureUsage("New Shopping Cart Feature");
53+
```
54+
55+
React error boundaries do not catch event handler, async, or manually swallowed errors. Submit those explicitly.
56+
57+
## Source Anchors
58+
59+
- `packages/react/README.md`
60+
- `packages/react/src/ExceptionlessErrorBoundary.tsx`
61+
- `example/react/src/App.jsx`

0 commit comments

Comments
 (0)