feat(eventbrite): add eventbrite integration

This commit is contained in:
Rıdvan Akca
2024-06-11 10:44:29 +02:00
parent e0d610071d
commit 22b4a04567
11 changed files with 184 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { URLSearchParams } from 'url';
export default async function generateAuthUrl($) {
const oauthRedirectUrlField = $.app.auth.fields.find(
(field) => field.key == 'oAuthRedirectUrl'
);
const redirectUri = oauthRedirectUrlField.value;
const searchParams = new URLSearchParams({
response_type: 'code',
client_id: $.auth.data.clientId,
redirect_uri: redirectUri,
});
const url = `https://www.eventbrite.com/oauth/authorize?${searchParams.toString()}`;
await $.auth.set({
url,
});
}