@tpointurier/ally-patreon
is a patreon driver for AdonisJS Ally.
Getting Started
This package is available in the npm registry.
npm install @tpointurier/ally-patreon
Next, configure the package by running the followind command.
node ace configure @tpointurier/ally-patreon
Alternatively, you can use a single command to install and configure the package:
node ace add @tpointurier/ally-patreon
Then register the service inside the configuration file config/ally.ts
.
import { patreon } from '@tpointurier/ally-patreon'
const allyConfig: AllyConfig = {
patreon: patreon({
clientId: env.get('PATREON_CLIENT_ID'),
clientSecret: env.get('PATREON_CLIENT_SECRET'),
callbackUrl: env.get('PATREON_CALLBACK_URL'),
scopes: ['openid', 'profile', 'email'],
}),
}
Available Scopes
Patreon OAuth2 supports various scopes that you can use to request different levels of access. Here are some commonly used scopes:
identity
: Provides read access to data about the user. See the /identity endpoint documentation for details about what data is available.identity[email]
: Provides read access to the user’s email.identity.memberships
: Provides read access to the user’s memberships.campaigns
: Provides read access to basic campaign data. See the /campaign endpoint documentation for details about what data is available.w:campaigns.webhook
: Provides read, write, update, and delete access to the campaign’s webhooks created by the client.campaigns.members
: Provides read access to data about a campaign’s members. See the /members endpoint documentation for details about what data is available. Also allows the same information to be sent via webhooks created by your client.campaigns.members[email]
: Provides read access to the member’s email. Also allows the same information to be sent via webhooks created by your client.campaigns.members.address
: Provides read access to the member’s address, if an address was collected in the pledge flow. Also allows the same information to be sent via webhooks created by your client.campaigns.posts
: Provides read access to the posts on a campaign.
You can add these scopes to the configuration like this:
scopes: ['identity', 'identity[email]']
For a complete list of available scopes, please refer to the Patreon permissions reference.