Before adding AppKit, you need a JavaScript project with a module bundler. If you already have one, skip the scaffold step. The Buffer polyfill is required either way — AppKit’s dependencies (Documentation Index
Fetch the complete documentation index at: https://companyname-a7d5b98e-feature-fumodocs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
@ton/core and @ton/crypto) use Node.js’ Buffer global, which browsers don’t expose and bundlers (Vite, esbuild, Rollup, Parcel) don’t polyfill automatically. Without it, the first call into @ton/core — usually address parsing — throws ReferenceError: Buffer is not defined.
The polyfill must run before any AppKit import. Load it from a dedicated module in the HTML entry, ahead of the application script — relying on import order inside the entry file alone is fragile.
The steps below use Vite. The same pattern applies to any module-based bundler (Webpack, Parcel, Rollup): a dedicated polyfill module referenced from the HTML entry, before the application script.
Scaffold a project (skip if you already have one)
Create a new Vite project with the React + TypeScript template.Swap
pnpm for npm create or yarn create if you don’t use pnpm.Create a polyfill module
Add a file that imports
buffer and exposes it on window. Use .ts for TypeScript projects, .js otherwise.Next steps
React
Install
@ton/appkit-react with TanStack Query and TON Connect UI for React.Vanilla JS
Install
@ton/appkit with TON Connect UI.