Skip to content

Getting Started

Install TypeGPU using the package manager of your choice.

npm install typegpu

TypeScript doesn’t yet ship WebGPU types by default, so we install them separately:

npm install --save-dev @webgpu/types

Then add the following to your tsconfig.json:

{
"compilerOptions": {
"types": ["@webgpu/types"],
// ...
},
// ...
}

To install the official TypeGPU Skill, head to the Software Mansion Skills repository and select the TypeGPU skill during the setup process. You can also use the experimental TypeGPU MCP to make it easier for agents to catch runtime errors and inspect the generated WGSL code along with other useful runtime information.

Our live examples showcase many use-cases of TypeGPU. Feel free to check them out! You can also open each of them on StackBlitz in order to edit the code and see the preview update live, or to bootstrap your own project.

WebGPU types are not available

If WebGPU types, such as GPUDevice or GPUBuffer, are not recognized in your project, make sure to install the officially maintained @webgpu/types npm package.

npm install --save-dev @webgpu/types

Then in tsconfig.json:

{
// ...
"compilerOptions": {
// ...
"types": ["@webgpu/types"]
}
}

Or you can use typeRoots:

{
"compilerOptions": {
"typeRoots": ["./node_modules/@webgpu/types", "./node_modules/@types"]
}
}

If you encounter any other issues, make sure to look into the rest of our docs, as well as the WebGPU or the react-native-wgpu documentations. For any further questions, you can contact us via the Software Mansion Community Discord or on GitHub.