> ## 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.

# Configuratie van AppSignal voor JavaScript

## AppSignal instellen

Om AppSignal te configureren voor front-end JavaScript raden we aan om een `appsignal.js`-bestand met de AppSignal-configuratie te maken in de hoofdmap van uw project of in de `src`-map.
Importeer vervolgens het configuratiebestand vanuit de code van uw app voordat er andere pakketten worden geladen of geïmporteerd.

In het onderstaande voorbeeld staat er een `appsignal.js`-bestand in de hoofdmap van de applicatie. Op regel 8 hebben we de configuratieoptie `namespace` toegevoegd.

<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>

## De configuratie aanpassen

U kunt de foutrapportage vanuit uw applicatie aanpassen met de [configuratieopties voor front-end](/front-end/configuration/options).

Hier is een voorbeeld van hoe de [namespace-optie](/front-end/configuration/options#namespace) wordt aangepast.

<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>

## De AppSignal-configuratie laden

Wanneer u klaar bent met de configuratie van uw applicatie, laadt u het `appsignal.js`-bestand bovenaan het hoofdbestand van uw applicatie, zoals in het voorbeeld hieronder:

<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>

Nadat uw applicatie de AppSignal JavaScript-library heeft geladen, volgt u alle [stappen in de installatiehandleiding](/front-end/installation), voegt u [integraties](/front-end/integrations) en [plug-ins](/front-end/plugins) toe en past u uw [configuratie](/front-end/configuration/options) aan.
