Skip to content

Commit 49cb7e5

Browse files
feat(provider): add Mailchimp provider (#1781)
1 parent b95182d commit 49cb7e5

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

src/providers/mailchimp.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export default function Mailchimp(options) {
2+
return {
3+
id: 'mailchimp',
4+
name: 'Mailchimp',
5+
type: 'oauth',
6+
version: '2.0',
7+
scope: '',
8+
params: { grant_type: 'authorization_code' },
9+
accessTokenUrl: 'https://login.mailchimp.com/oauth2/token',
10+
authorizationUrl: 'https://login.mailchimp.com/oauth2/authorize?response_type=code',
11+
profileUrl: 'https://login.mailchimp.com/oauth2/metadata',
12+
profile: (profile) => {
13+
return {
14+
id: profile.login.login_id,
15+
name: profile.accountname,
16+
email: profile.login.email,
17+
image: null
18+
}
19+
},
20+
...options
21+
}
22+
}

www/docs/providers/mailchimp.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
id: mailchimp
3+
title: Mailchimp
4+
---
5+
6+
## Documentation
7+
8+
https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/
9+
10+
## Configuration
11+
12+
https://admin.mailchimp.com/account/oauth2/client/
13+
14+
## Example
15+
16+
```js
17+
import Providers from `next-auth/providers`
18+
...
19+
providers: [
20+
Providers.Mailchimp({
21+
clientId: process.env.MAILCHIMP_CLIENT_ID,
22+
clientSecret: process.env.MAILCHIMP_CLIENT_SECRET
23+
})
24+
]
25+
...
26+
```

0 commit comments

Comments
 (0)