> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AppSignal für JavaScript-Konfiguration

## AppSignal einrichten

Um AppSignal für Front-end-JavaScript zu konfigurieren, empfehlen wir, eine `appsignal.js`-Datei mit der AppSignal-Konfiguration im Stamm- oder `src`-Verzeichnis Ihres Projekts zu erstellen.
Binden Sie die Konfigurationsdatei dann im Anwendungscode ein (per `require` oder `import`), bevor andere Pakete eingebunden werden.

Im folgenden Beispiel befindet sich eine `appsignal.js`-Datei im Stammverzeichnis des Anwendungsverzeichnisses. In Zeile 8 haben wir die Konfigurationsoption `namespace` hinzugefügt.

<CodeGroup>
  ```javascript JavaScript theme={null}
  // For ES Module via npm/yarn, or with import maps
  import Appsignal from "@appsignal/javascript";
  // For CommonJS module via npm/yarn
  const Appsignal = require("@appsignal/javascript").default;
  // With the JSPM.dev CDN
  import Appsignal from "https://jspm.dev/@appsignal/javascript";

  const appsignal = new Appsignal({
    key: "<YOUR FRONTEND API KEY>",
  });

  module.exports = { appsignal };
  ```
</CodeGroup>

## Konfiguration anpassen

Sie können die Fehlerberichterstattung Ihrer Anwendung mit den [Front-end-Konfigurationsoptionen](/front-end/configuration/options) anpassen.

Hier ein Beispiel, wie die [Option namespace](/front-end/configuration/options#namespace) angepasst wird.

<CodeGroup>
  ```diff Example namespace option theme={null}
   const appsignal = new Appsignal({
     key: "<YOUR FRONTEND API KEY>",
  +  namespace: "frontend", // Configure the AppSignal namespace for front-end errors in this app
   });
  ```
</CodeGroup>

## Die AppSignal-Konfiguration einbinden

Sobald Sie mit der Konfiguration Ihrer Anwendung fertig sind, binden Sie die `appsignal.js`-Datei ganz oben in der Hauptdatei Ihrer Anwendung ein, wie im folgenden Beispiel:

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Place this at the top
  // Import the file created in the previous step
  const { appsignal } = require("./appsignal"); // Update to the location used in the previous step

  // Place your app code below this
  ```
</CodeGroup>

Nachdem Ihre Anwendung die AppSignal-JavaScript-Bibliothek geladen hat, folgen Sie unbedingt allen [Schritten der Installationsanleitung](/front-end/installation), fügen Sie [Integrationen](/front-end/integrations) und [Plugins](/front-end/plugins) hinzu und passen Sie Ihre [Konfiguration](/front-end/configuration/options) an.
