# KI-gestützte Integration

Verwenden Sie KI-Programmierassistenten, um das Pushwoosh Cordova-Plugin in Ihrem Projekt zu integrieren und zu konfigurieren. Indem Sie Ihren Assistenten mit dem [Context7](https://context7.com/) MCP-Server verbinden, erhält er Zugriff auf aktuelle Plugin-Dokumentation, Codebeispiele und API-Referenzen – so kann er präzisen, funktionierenden Integrationscode generieren.

<Aside type="note">
Ihr KI-Assistent muss [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) unterstützen, um Context7 zu verwenden. Zu den unterstützten Tools gehören **Claude Code**, **Cursor**, **Windsurf**, **Cline** und andere.
</Aside>

## Wie es funktioniert

Context7 ist ein MCP-Server, der KI-Assistenten aktuelle Bibliotheksdokumentationen zur Verfügung stellt. Wenn Ihr Assistent Zugriff auf Context7 hat, kann er die neuesten Dokumente, Code-Snippets und API-Referenzen des Pushwoosh Cordova-Plugins direkt während des Gesprächs abrufen – anstatt sich auf potenziell veraltete Trainingsdaten zu verlassen.

Die Bibliotheks-ID des Pushwoosh Cordova-Plugins auf Context7 lautet: **`/pushwoosh/pushwoosh-phonegap-plugin`**

## Context7 einrichten

Fügen Sie [Context7](https://github.com/upstash/context7#installation) zur MCP-Konfiguration Ihres KI-Assistenten hinzu:

<Tabs>
  <TabItem label="Claude Code">
Führen Sie den folgenden Befehl aus:

```bash
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
```
  </TabItem>
  <TabItem label="Cursor / Windsurf">
Fügen Sie dies zu Ihrer MCP-Konfigurationsdatei (`.cursor/mcp.json` oder einer entsprechenden Datei) hinzu:

```json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp@latest"]
    }
  }
}
```
  </TabItem>
</Tabs>

## Beispiel-Prompts

Sobald Context7 konfiguriert ist, können Sie Prompts in natürlicher Sprache verwenden, um das Plugin zu integrieren. Nachfolgend finden Sie sofort einsatzbereite Prompts für gängige Aufgaben.

### Grundlegende Plugin-Integration

```text
Integrate Pushwoosh Cordova plugin into my Cordova project.

Requirements:
- Install pushwoosh-cordova-plugin via cordova plugin add
- Initialize Pushwoosh with my App ID in onDeviceReady
- Register for push notifications and handle push-receive and push-notification events

Use Context7 MCP to fetch Pushwoosh Cordova plugin documentation.
```

### Handhabung von Push-Benachrichtigungen

```text
Show me how to handle push notification callbacks (receive, open) with
Pushwoosh Cordova plugin. I want to process push payload data and navigate
to specific pages based on custom data.

Use Context7 MCP to fetch Pushwoosh Cordova plugin documentation for push event handling.
```

### Benutzersegmentierung mit Tags

```text
Show me how to use Pushwoosh tags for user segmentation in a Cordova app.
I need to set tags, get tags, and set user ID for cross-device tracking.

Use Context7 MCP to fetch Pushwoosh Cordova plugin documentation for setTags and getTags.
```

<Aside type="tip">
Wenn Sie **„Use Context7 MCP to fetch Pushwoosh Cordova plugin documentation“** am Ende Ihres Prompts hinzufügen, weisen Sie den KI-Assistenten an, die neuesten Plugin-Dokumente abzurufen, bevor er Code generiert.
</Aside>

## Was der KI-Assistent erhält

Wenn Ihr Assistent Context7 nach dem Pushwoosh Cordova-Plugin abfragt, erhält er:

- **Installationsanweisungen** – Plugin-Installation und plattformspezifische Einrichtung
- **API-Referenz** – öffentliche Methoden, Ereignisse und Callback-Signaturen
- **Codebeispiele** – JavaScript-Snippets für gängige Anwendungsfälle
- **Ereignisdokumentation** – push-receive, push-notification und andere Event-Handler
- **Konfigurationsdetails** – Plugin-Variablen, plattformspezifische Einstellungen und Berechtigungen