> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Next.js Starter

If you're planning on using Pinata inside of a web application, this template is a great way to get started. Pinata uses the builtin Next.js `api` routes to keep your API keys secure, and we make it easy to spin up!

## Getting Started

<iframe width="600" height="400" src="https://www.youtube.com/embed/TaJzw_2hEJI" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen style={{ width: '100%', borderRadius: '0.5rem' }} />

### API Keys and Gateway

If you haven't already, visit the [keys page](https://app.pinata.cloud/developers/api-keys) and create an API key.

You can also use your own Dedicated Gateway domain, which you can get from the [Gateways page](https://app.pinata.cloud/gateway).

### Starting Up the App

Create a new Pinata project using this command:

```
npx create-pinata-app
```

Follow the prompts in the command line to create the project. Once complete, change into the new project directory and run the app with the following command:

```
npm run dev
```

You can edit the `pages/index.js` file and the API route file `pages/api/files` to see the Pinata functionality and extend it or make changes.

### Environment Variables

This project makes use of both public and private environment variables. The private environment variables are used to protect sensitive data like your Pinata API keys. The public environment variables are convenient central variable housing.

Read more about [how environment variables work with Next.js here](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables).

There is a `.env.sample` file you can copy and rename to `.env.local` for use in your project. Be sure to fill out the environment variable values in the `.env.local` file with your actual values.

### Learn More

For more information about building apps with Pinata and IPFS, check out the following resources:

* [Pinata Docs](https://docs.pinata.cloud)
* [Pinata Tutorials](https://medium.com/pinata)
* [Quick Start Recipes](https://docs.pinata.cloud/recipes)
