---
title: Contributing to BetterAuth
description: Getting started to contribute to BetterAuth
---

Hello and welcome! We're thrilled that you're interested in contributing to Better Auth. Whether you're fixing bugs, adding new features, improving documentation, or just sharing ideas, your contribution helps make Better Auth better for everyone.

## Getting Started

Before diving in, here are a few important resources:

- Take a look at our existing <Link href="https://github.com/better-auth/better-auth/issues">issues</Link> and <Link href="https://github.com/better-auth/better-auth/pulls">pull requests</Link>
- Join our community discussions in <Link href="https://discord.gg/GYC3W7tZzb">Discord</Link>

## Development Setup

To get started with development:

<Callout type="warn">
  Make sure you have <Link href="https://nodejs.org/en/download">Node.JS</Link>{" "}
  installed, preferably on LTS.
</Callout>

<Steps>

    <Step>
        ### 1. Fork the repository

        Visit https://github.com/better-auth/better-auth

        Click the "Fork" button in the top right.

    </Step>

    <Step>
        ### 2. Clone your fork

        ```bash
        # Replace YOUR-USERNAME with your GitHub username
        git clone https://github.com/YOUR-USERNAME/better-auth.git
        cd better-auth
        ```
    </Step>

    <Step>
        ### 3. Install dependencies

        Make sure you have <Link href="https://pnpm.io/installation">pnpm</Link> installed!

        ```bash
        pnpm install
        ```
    </Step>

    <Step>
        ### 4. Prepare ENV files

        Copy the example env file to create your new `.env` file.

        ```bash
        cp -n ./docs/.env.example ./docs/.env
        ```
    </Step>

</Steps>

## Making changes

Once you have an idea of what you want to contribute, you can start making changes. Here are some steps to get started:

<Steps>
    <Step>
        ### 1. Create a new branch

        ```bash
        # Make sure you're on main
        git checkout main

        # Pull latest changes
        git pull upstream main

        # Create and switch to a new branch
        git checkout -b feature/your-feature-name
        ```
    </Step>
    <Step>
        ### 2. Start development server

        Start the development server:

        ```bash
        pnpm dev
        ```

        To start the docs server:

        ```bash
        pnpm -F docs dev
        ```
    </Step>
    <Step>
        ### 3. Make Your Changes

        * Make your changes to the codebase.

        * Write tests if needed. (Read more about testing <Link href="/docs/contribute/testing">here</Link>)

        * Update documentation.  (Read more about documenting <Link href="/docs/contribute/documenting">here</Link>)

    </Step>

</Steps>

## Best Practices

- Write clear commit messages
- Update documentation to reflect your changes
- Add tests for new features
- Follow our coding standards
- Keep pull requests focused on a single change

## Need Help?

Don't hesitate to ask for help! You can:

- Open an <Link href="https://github.com/better-auth/better-auth/issues">issue</Link> with questions
- Join our <Link href="https://discord.gg/GYC3W7tZzb">community discussions</Link>
- Reach out to project maintainers

Together, we can make Better Auth an even better authentication solution. Thank you for being part of our community!
Your contributions are greatly appreciated, and we look forward to collaborating with you!
