### Install React Canny
Source: https://github.com/kearisp/react-canny/blob/master/README.md
Install the react-canny package using npm.
```bash
npm install react-canny
```
--------------------------------
### Install react-canny
Source: https://context7.com/kearisp/react-canny/llms.txt
Install the react-canny package and its peer dependency, react.
```bash
npm install react-canny
# peer dependency
npm install react
```
--------------------------------
### Basic CannyProvider Usage
Source: https://context7.com/kearisp/react-canny/llms.txt
Use CannyProvider to wrap components that utilize Canny features. This basic example does not include user identification.
```tsx
import React from "react";
import { CannyProvider } from "react-canny";
const APP_ID = "6123abc456def7890";
// Basic usage — no user identification
export const AppBasic = () => (
);
```
--------------------------------
### CannyFeedback with Custom Wrapper
Source: https://context7.com/kearisp/react-canny/llms.txt
Customize the container element for the CannyFeedback widget using the 'component' prop. This example uses a 'section' element.
```tsx
import React from "react";
import { CannyProvider, CannyFeedback } from "react-";
const APP_ID = "6123abc456def7890";
const BOARD_TOKEN = "a1b2c3d4-e5f6-7890-abcd-ef1234567890";
// Using a custom wrapper element
export const FeedbackSection = () => (
);
```
--------------------------------
### Load Canny SDK Manually with CannyLoader
Source: https://context7.com/kearisp/react-canny/llms.txt
Demonstrates how to manually load the Canny SDK using the CannyLoader utility. This is useful for advanced scenarios outside of the CannyProvider. Ensure the scriptId and URL are correct.
```typescript
import { CannyLoader } from "react-canny";
// Load the Canny SDK manually (CannyProvider does this automatically)
async function loadCannySDK() {
try {
await CannyLoader.load("canny-jssdk", "https://canny.io/sdk.js");
console.log("Canny SDK loaded");
} catch (err) {
console.error("Failed to load Canny SDK:", err);
}
}
```
--------------------------------
### Canny Class (Low-Level API)
Source: https://context7.com/kearisp/react-canny/llms.txt
The `Canny` class provides a low-level interface to the Canny SDK, acting as a queue-backed wrapper around `window.Canny`. It buffers calls made before the SDK loads and flushes them once ready, allowing direct interaction for advanced use cases.
```APIDOC
## `Canny` class (low-level)
The `Canny` class is a thin queue-backed wrapper around the global `window.Canny` SDK. It buffers calls made before the SDK script loads and flushes them once it's ready. Advanced consumers who need to bypass the React components can instantiate and use this class directly.
### Methods:
- `identify(appId, user, callback)`: Identifies a user with Canny.
- `render(options)`: Renders the feedback board.
- `initChangelog(options)`: Initializes the changelog popup.
- `closeChangelog()`: Closes the changelog popup programmatically.
- `authenticateCannyLink(url)`: Generates an SSO-authenticated link.
- `flush()`: Manually flushes queued calls after the SDK loads.
```
--------------------------------
### CannyLoader.load
Source: https://context7.com/kearisp/react-canny/llms.txt
Loads the Canny SDK by injecting a script tag into the document head. It deduplicates concurrent load requests for the same scriptId and returns a Promise that resolves when the script is loaded. This is used internally by CannyProvider but can be called directly for manual SDK loading.
```APIDOC
## `CannyLoader.load(scriptId, src)`
### Description
Injects a `