
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
storybook-addon-next-auth
Advanced tools
Use NextAuth.js in your Storybook stories.
Install this library by adding it to your devDependencies:
yarn:
yarn install --dev storybook-addon-next-auth
npm:
npm install --save-dev storybook-addon-next-auth
pnpm:
pnpm add --save-dev storybook-addon-next-auth
Update .storybook/main.js
and append to your list of addons:
// .storybook/main.js
module.exports = {
addons: ['storybook-addon-next-auth']
}
After restarting your storybook, an additional icon will appear in the toolbar. It allows you to select the current session state:
You may now control and test your component state of useSession()
by the toolbar items:
If you need to change your stories code while using session values, you may access those by the useSession
hook.
import { useSession } from 'next-auth/react';
export const MyStory = (props) => {
// get access to current session data
const session = useSession();
...
This component brings a default set of auth states: unknown
, loading
, unauthenticated
and authenticated
.
⏱ Coming Soon
⏱ Coming Soon
Author: Emilio Schaedler Heinzmann
Special thanks for Tom Freudenberg, the creator of next-auth-mock, where I've based my work for this library.
FAQs
Use NextAuth.js in your Storybook stories
The npm package storybook-addon-next-auth receives a total of 0 weekly downloads. As such, storybook-addon-next-auth popularity was classified as not popular.
We found that storybook-addon-next-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.