# Getting Started (/spud-api/getting-started)



{/* source: packages/api/readme.md:3-37 */}

## What is this? [#what-is-this]

Spud makes the browser [Gamepad API](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API) more fun to use. Add it to your game loop for a simple way to read button presses from controllers, work with joysticks, trigger haptics, identify the controller layout, and much more. It's a lightweight wrapper that still allows for low-level control when you need it.

## Installation [#installation]

```sh
# with bun
bun add @spud.gg/api

# ... or the equivalent call to npm, pnpm, yarn, etc.
```

## Features [#features]

* Built-in analog stick deadzone handling with axial and radial normalization
* Simplified wrappers for haptics
* Simplified gamepad button handling
* Utilities for snapping analog sticks to 4 or 8 directions
* Gamepad layout and base model detection
* Written with tree-shaking in mind

And a handful of optional utilities that aren't tied to the Gamepad API but can come in handy when you're making web games:

* Easing functions for animations
* Web Audio helpers for sound effects and music playback
* Mouse and keyboard input handlers that well in game loops
