next-client-cookies
Advanced tools
Comparing version 1.0.0-alpha.0 to 1.0.0-alpha.1
{ | ||
"name": "next-client-cookies", | ||
"version": "1.0.0-alpha.0", | ||
"version": "1.0.0-alpha.1", | ||
"description": "SSR and client support for Next.js v13 cookies (app directory)", | ||
@@ -34,2 +34,7 @@ "keywords": [ | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./server": { | ||
"require": "./dist/server.js", | ||
"import": "./dist/server.mjs", | ||
"types": "./dist/server.d.ts" | ||
} | ||
@@ -36,0 +41,0 @@ }, |
@@ -30,2 +30,6 @@ # Next.js Client Cookies | ||
### Within a client side component | ||
This will work both on the client and server side for SSR. | ||
```jsx | ||
@@ -52,1 +56,23 @@ 'use client'; | ||
``` | ||
### Within a server only component | ||
Will produce the same `Cookies` interfaces using Next.js's `cookies()` helper. | ||
```jsx | ||
import { getCookies } from 'next-client-cookies/server'; | ||
const MyComponent = () => { | ||
const cookies = useCookies(); | ||
return ( | ||
<div> | ||
<p>My cookie value: {cookies.get('my-cookie')}</p> | ||
</div> | ||
); | ||
}; | ||
``` | ||
## License | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29453
15
354
77