rsnext/examples/with-cookies-next/README.md
Andrei Zanouski e8bbf14865
Add example with cookies-next package (#31243)
* Add example with cookies-next package

* Update examples/with-cookies-next/package.json

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* add typescript and update cookies-next version

* Update examples/with-cookies-next/.gitignore

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* add @types/node in devDependencies

* update cookies-next

* Apply suggestions from code review

* change the function naming to be consistent with the idiom of working with a container of cookies and prettier-fix

* lint-fix

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-07-22 10:32:54 -05:00

27 lines
1.3 KiB
Markdown

# With cookies-next
In this example, we are getting, setting and removing cookies
This package works on client side and server side
- can be used on the client side, anywhere
- can be used for server side rendering in getServerSideProps
- can be used in API handlers
## Deploy your own
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-cookies-next)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-cookies-next&project-name=with-cookies-next&repository-name=with-cookies-next)
## How to use
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
```bash
npx create-next-app --example with-cookies-next with-cookies-next-app
# or
yarn create next-app --example with-cookies-next with-cookies-next-app
```
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).