Installation
The MagicFeedback SDK is published on npm as @magicfeedback/native.
Install
Section titled “Install”npm install @magicfeedback/nativeOr with yarn / pnpm:
yarn add @magicfeedback/nativepnpm add @magicfeedback/nativeImport the stylesheet
Section titled “Import the stylesheet”The SDK ships a default stylesheet. Import it once at the entry point of your app, or load it from your CDN of choice in plain HTML.
Bundler (Vite, Webpack, Next.js, etc.)
Section titled “Bundler (Vite, Webpack, Next.js, etc.)”import "@magicfeedback/native/dist/styles/magicfeedback-default.css";Plain HTML
Section titled “Plain HTML”<link rel="stylesheet" href="./node_modules/@magicfeedback/native/dist/styles/magicfeedback-default.css"/>The stylesheet is required for the survey to render correctly. You can fully override its appearance via CSS variables.
Browser requirements
Section titled “Browser requirements”This SDK is browser-only. It relies on window, document, navigator, and localStorage. Do not call it during server-side rendering — wrap it in a client-only component or run it inside useEffect (React) or onMount (Svelte/Vue).
For React Native, see the React Native reference.
Verify the install
Section titled “Verify the install”import magicfeedback from "@magicfeedback/native";
magicfeedback.init({ env: "dev", debug: true });console.log("MagicFeedback SDK initialized");If you see the log line with no errors, you are ready to render a form — head to the Quickstart.