Skip to content

Commit

Permalink
Updated Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
k8pai committed Sep 20, 2023
1 parent 282454f commit 6b53266
Showing 1 changed file with 8 additions and 131 deletions.
139 changes: 8 additions & 131 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,143 +4,38 @@ A cli tool to initialize nextauth setup with a simple command.

## Commands and it's use

### Syntax
### Installation

```bash
nextauth init [options] [command]
npm i -g nextauth-cli@latest
```

### **Commands**

- `next-app` - For Next.js Projects with a **'/pages'** Router setup.
- `next-pages` - For Next.js Projects with a **'/pages'** Router setup.

### **Options**

**Provider Flags**

- `--Apple` - Adds Apple Provider.
- `--Atlassian` - Adds Atlassian Provider.
- `--Auth0` - Adds Auth0 Provider.
- `--Authentik` - Adds Authentik Provider.
- `--AzureAD` - Adds AzureAD Provider.
- `--AzureB2C` - Adds AzureB2C Provider.
- `--Battlenet` - Adds Battlenet Provider.
- `--Box` - Adds Box Provider.
- `--BoxyHQSAML` - Adds BoxyHQSAML Provider.
- `--Bungie` - Adds Bungie Provider.
- `--Cognito` - Adds Cognito Provider.
- `--Coinbase` - Adds Coinbase Provider.
- `--Discord` - Adds Discord Provider.
- `--Dropbox` - Adds Dropbox Provider.
- `--DuendeIDS6` - Adds DuendeIDS6 Provider.
- `--Eveonline` - Adds Eveonline Provider.
- `--Facebook` - Adds Facebook Provider.
- `--Faceit` - Adds Faceit Provider.
- `--FortyTwoSchool` - Adds FortyTwoSchool Provider.
- `--Foursquare` - Adds Foursquare Provider.
- `--Freshbooks` - Adds Freshbooks Provider.
- `--Fusionauth` - Adds Fusionauth Provider.
- `--GitHub` - Adds GitHub Provider.
- `--Gitlab` - Adds Gitlab Provider.
- `--Google` - Adds Google Provider.
- `--Hubspot` - Adds Hubspot Provider.
- `--Instagram` - Adds Instagram Provider.
- `--Kakao` - Adds Kakao Provider.
- `--Keycloak` - Adds Keycloak Provider.
- `--Line` - Adds Line Provider.
- `--LinkedIn` - Adds LinkedIn Provider.
- `--Mailchimp` - Adds Mailchimp Provider.
- `--Mailru` - Adds Mailru Provider.
- `--Medium` - Adds Medium Provider.
- `--Naver` - Adds Naver Provider.
- `--Netlify` - Adds Netlify Provider.
- `--Okta` - Adds Okta Provider.
- `--Onelogin` - Adds Onelogin Provider.
- `--Osso` - Adds Osso Provider.
- `--Osu` - Adds Osu Provider.
- `--Passage` - Adds Passage Provider.
- `--Patreon` - Adds Patreon Provider.
- `--Pinterest` - Adds Pinterest Provider.
- `--Pipedrive` - Adds Pipedrive Provider.
- `--Reddit` - Adds Reddit Provider.
- `--Salesforce` - Adds Salesforce Provider.
- `--Slack` - Adds Slack Provider.
- `--Spotify` - Adds Spotify Provider.
- `--Strava` - Adds Strava Provider.
- `--Todoist` - Adds Todoist Provider.
- `--Trakt` - Adds Trakt Provider.
- `--Twitch` - Adds Twitch Provider.
- `--Twitter` - Adds Twitter Provider.
- `--UnitedEffects` - Adds UnitedEffects Provider.
- `--Vk` - Adds Vk Provider.
- `--Wikimedia` - Adds Wikimedia Provider.
- `--Wordpress` - Adds Wordpress Provider.
- `--WorkOS` - Adds WorkOS Provider.
- `--Yandex` - Adds Yandex Provider.
- `--Zitadel` - Adds Zitadel Provider.
- `--Zoho` - Adds Zoho Provider.
- `--Zoom` - Adds Zoom Provider.

**Configuration Flags**

- `--env` - Create or Update `.env.example` file with all provider variables that has to be declared!
- `--ts` - Provide if you have a typescript project setup or not. `js` files are created by Default.

**Help**

- `-h`, `--help` - display help for command.

---

### Base Initialization ⚒️

- Configures `/api/auth/[...nextauth].js` | `/api/auth/[...nextauth]/route.js` files, with base configuration of `nextauth`.
- Adds a `GitHubProvider` Provider to the base auth file.

For Next.js Projects with _/app_ folder structure

```bash
nextauth next-app --GitHub
```

For Next.js Projects with _/pages_ folder structure

```bash
nextauth next-pages --GitHub
nextauth --GitHub
```

### Configuration of .env file. ✅

- Comes with the base Configuration along with a sample `.env.example` file with all the `ID` and `SECRET` variables used mentioned.
- We don't want to peek in your `.env` files, hence `.env.example`. 🫣

For Next.js Projects with _/app_ folder structure

```bash
nextauth next-app --GitHub --env
```

For Next.js Projects with _/pages_ folder structure

```bash
nextauth next-pages --GitHub --env
nextauth --GitHub --env
```

### Configuration for typescript projects. ✔️

- `--ts` flag generates **.ts** files in the project structure with typesafety. If not specified files with `.js` extentions are created by default.

For Next.js Projects with _/app_ folder structure

```bash
nextauth next-app --GitHub --env --ts
```

For Next.js Projects with _/pages_ folder structure

```bash
nextauth next-pages --GitHub --env --ts
nextauth --GitHub --env --ts
```

### Configuration for projects with Adapters. ✔️
Expand All @@ -149,28 +44,8 @@ nextauth next-pages --GitHub --env --ts
- `--adapter` takes in an argument, of type `AdapterType` which includes **16** adapters that are currently supported by [authjs.dev](https://authjs.dev/reference/adapters).
- Checkout the status of all the adapters that are currently ready to use, and under updation.

For Next.js Projects with _/app_ folder structure

```bash
nextauth next-app --GitHub --env --ts --adapter prisma
```

OR

```bash
nextauth next-app --GitHub --env --ts --adapter=prisma
```

For Next.js Projects with _/pages_ folder structure

```bash
nextauth next-pages --GitHub --env --ts --adapter prisma
```

OR

```bash
nextauth next-pages --GitHub --env --ts --adapter=prisma
nextauth --GitHub --env --ts --adapter prisma
```

## Adapters Support
Expand Down Expand Up @@ -206,9 +81,11 @@ nextauth next-pages --GitHub --env --ts --adapter=prisma
- `Bungie`
- `Cognito`
- `Coinbase`
- `Credentials`
- `Discord`
- `Dropbox`
- `DuendeIDS6`
- `Email`
- `Eveonline`
- `Facebook`
- `Faceit`
Expand Down

0 comments on commit 6b53266

Please sign in to comment.