Skip to content

Commit

Permalink
feat(provider): add Mailchimp provider (#1781)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra committed Apr 23, 2021
1 parent b95182d commit 49cb7e5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/providers/mailchimp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default function Mailchimp(options) {
return {
id: 'mailchimp',
name: 'Mailchimp',
type: 'oauth',
version: '2.0',
scope: '',
params: { grant_type: 'authorization_code' },
accessTokenUrl: 'https://login.mailchimp.com/oauth2/token',
authorizationUrl: 'https://login.mailchimp.com/oauth2/authorize?response_type=code',
profileUrl: 'https://login.mailchimp.com/oauth2/metadata',
profile: (profile) => {
return {
id: profile.login.login_id,
name: profile.accountname,
email: profile.login.email,
image: null
}
},
...options
}
}
26 changes: 26 additions & 0 deletions www/docs/providers/mailchimp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: mailchimp
title: Mailchimp
---

## Documentation

https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/

## Configuration

https://admin.mailchimp.com/account/oauth2/client/

## Example

```js
import Providers from `next-auth/providers`
...
providers: [
Providers.Mailchimp({
clientId: process.env.MAILCHIMP_CLIENT_ID,
clientSecret: process.env.MAILCHIMP_CLIENT_SECRET
})
]
...
```

1 comment on commit 49cb7e5

@vercel
Copy link

@vercel vercel bot commented on 49cb7e5 Apr 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.