Skip to main content

Import

import {
  createOAuthInitHandler,
  createOAuthCallbackHandler,
  githubConfig,
  MemoryTokenStore,
  createOAuthDisconnectHandler,
  createOAuthStatusHandler,
} from "veryfront/oauth";

Examples

// Create OAuth routes with pre-configured providers
import { createOAuthInitHandler, createOAuthCallbackHandler, gmailConfig } from "veryfront/oauth";

// app/api/auth/gmail/route.ts
export const GET = createOAuthInitHandler(gmailConfig);

// app/api/auth/gmail/callback/route.ts
export const GET = createOAuthCallbackHandler(gmailConfig);

Exports

Functions

NameDescription
createOAuthCallbackHandlerExchange auth code for tokens
createOAuthDisconnectHandlerRevoke and remove tokens
createOAuthInitHandlerRedirect user to OAuth provider
createOAuthStatusHandlerCheck OAuth connection status

Classes

NameDescription
MemoryTokenStoreIn-memory token store (dev)
OAuthProviderBase OAuth provider
OAuthServiceFull OAuth flow manager

Types

NameDescription
AuthorizationUrlOptionsAuthorization URL options
OAuthCallbackHandlerOptionscreateOAuthCallbackHandler() options
OAuthInitHandlerOptionscreateOAuthInitHandler() options
OAuthProviderConfigProvider config (client ID, scopes, URLs)
OAuthServiceConfigOAuth service config
OAuthStateOAuth redirect state param
OAuthTokensAccess + refresh tokens
TokenExchangeOptionsToken exchange options
TokenExchangeResultToken exchange result
TokenStoreToken storage interface

Constants

NameDescription
airtableConfigAirtable
asanaConfigAsana
bitbucketConfigBitbucket
boxConfigBox
calendarConfigGoogle Calendar
clickupConfigClickUp
confluenceConfigConfluence
discordConfigDiscord
driveConfigGoogle Drive
dropboxConfigDropbox
figmaConfigFigma
freshdeskConfigFreshdesk
githubConfigGitHub
gitlabConfigGitLab
gmailConfigGmail
hubspotConfigHubSpot
intercomConfigIntercom
jiraConfigJira
linearConfigLinear
mailchimpConfigMailchimp
mondayConfigMonday.com
notionConfigNotion
oneDriveConfigOneDrive
outlookConfigOutlook
pipedriveConfigPipedrive
quickbooksConfigQuickBooks
salesforceConfigSalesforce
sharePointConfigSharePoint
sheetsConfigGoogle Sheets
shopifyConfigShopify
slackConfigSlack
teamsConfigMicrosoft Teams
trelloConfigTrello
twitterConfigTwitter/X
webexConfigWebex
xeroConfigXero
zoomConfigZoom