OpnForm supports several OAuth integrations that enable users to connect external services for enhanced functionality. This guide covers setting up Google, Stripe, and Telegram OAuth integrations.

OpnForm handles OAuth redirect URLs automatically. You don’t need to manually configure redirect URLs in your OAuth applications - the system generates them dynamically based on your domain configuration.

Developer Guide

If you’re looking to add a new OAuth integration to OpnForm, check out the complete developer guide with architecture overview and implementation steps.

Available OAuth Integrations

Google OAuth

Google OAuth enables user authentication and integrates with Google Sheets for exporting form submissions.

Features

  • User Authentication: Allow users to sign up and log in with their Google accounts
  • Google One Tap: Seamless authentication with Google’s One Tap sign-in widget
  • Google Sheets Integration: Export form submissions directly to Google Sheets
  • Automatic Scope Management: OpnForm requests appropriate permissions based on usage

Setup Steps

1

Create Google Cloud Project

Navigate to the Google Cloud Console and create a new project or select an existing one.

2

Enable APIs

Enable the following APIs for your project:

  • Google+ API (for authentication)
  • Google Drive API (for Sheets integration)
  • Google Sheets API (for spreadsheet access)
3

Configure OAuth Consent Screen

  1. Go to APIs & Services > OAuth consent screen
  2. Choose External user type (unless using Google Workspace)
  3. Fill in the required information:
    • App name: Your application name
    • User support email: Your contact email
    • Developer contact information: Your email address
  4. Add scopes if needed (OpnForm handles this automatically)
  5. Add test users if your app is in testing mode
4

Create OAuth Credentials

  1. Go to APIs & Services > Credentials
  2. Click Create Credentials > OAuth 2.0 Client IDs
  3. Select Web application as the application type
  4. Add authorized origins:
    https://yourdomain.com
    
  5. Leave redirect URIs empty - OpnForm handles these automatically

For Google One Tap to work, ensure your domain is added to the authorized origins. This enables the seamless authentication widget to function properly.

Save the Client ID and Client Secret for environment configuration.

5

Configure Environment Variables

Add the following variables to your backend .env file:

GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_FONTS_API_KEY=your_google_fonts_api_key (optional)

The Google Fonts API key is optional and only needed if you want to use Google Fonts in your forms.

Stripe OAuth

Stripe OAuth enables payment processing capabilities within OpnForm, allowing you to collect payments through your forms.

Features

  • Payment Collection: Accept payments directly through forms
  • Multiple Accounts: Connect multiple Stripe accounts for different forms
  • Automatic Processing: Handle payment intents and confirmations seamlessly

Setup Steps

1

Create Stripe Application

  1. Log into your Stripe Dashboard
  2. Navigate to Settings > Connect > Platform settings
  3. Click Get started to enable Stripe Connect
2

Configure Platform Settings

  1. Set your Platform name and Support email
  2. Add your website URL in Brand settings
  3. Configure Redirect URIs (OpnForm handles these automatically)
  4. Save your settings
3

Get OAuth Credentials

  1. In Settings > Connect > Platform settings
  2. Find your Platform client ID in the OAuth settings section
  3. Note your Client secret (you may need to generate one)

Save the Client ID and Client Secret for environment configuration.

4

Configure Environment Variables

Add the following variables to your backend .env file:

STRIPE_CLIENT_ID=your_stripe_client_id
STRIPE_CLIENT_SECRET=your_stripe_client_secret

These OAuth credentials are separate from your regular Stripe API keys. The OAuth credentials enable connecting multiple Stripe accounts, while regular API keys are for direct payment processing.

Telegram OAuth

Telegram OAuth enables notification integration, allowing OpnForm to send form submission alerts to Telegram chats.

Features

  • Form Notifications: Receive instant notifications when forms are submitted
  • Rich Messages: Formatted messages with form data and submission details
  • Multiple Chats: Connect different Telegram accounts for various forms

Domain Requirement: Telegram requires that your bot is linked to a valid domain with HTTPS. Localhost URLs are not supported. For development, consider using a tunneling service like localtunnel to expose your local development server with a public HTTPS URL.

Setup Steps

1

Create Telegram Bot

  1. Open Telegram and search for @BotFather
  2. Start a conversation and send /newbot
  3. Follow the prompts to name your bot and choose a username
  4. Save the Bot Token provided by BotFather

Your bot token will look like: 123456789:ABCdefGHIjklMNOpqrsTUVwxyz

2

Link Domain to Bot

  1. Send /setdomain to @BotFather
  2. Select your bot from the list
  3. Enter your domain (e.g., yourdomain.com or for development: abc123.loca.lt)
  4. BotFather will confirm the domain has been linked

For Development: If you’re developing locally, use localtunnel to get a public HTTPS URL:

npm install -g localtunnel
lt --port 3000  # Replace 3000 with your local port

Use the provided .loca.lt URL as your domain with BotFather.

3

Configure Environment Variables

Add the following variable to your backend .env file:

TELEGRAM_BOT_TOKEN=your_bot_token # format: 1234567890:ABCdefGHIjklMNOpqrsTUVwxyz

The bot ID is automatically extracted from the bot token (the numeric part before the colon), so you don’t need to configure it separately.

4

Test Your Bot

  1. Start a conversation with your bot in Telegram
  2. Connect the bot in OpnForm’s integration settings
  3. Submit a test form to verify notifications work

You should receive a formatted message with form submission details.

Security Considerations

Important Security Notes:

  • Never commit OAuth credentials to version control
  • Use environment variables for all sensitive configuration
  • Regularly rotate your OAuth secrets and API keys
  • Monitor OAuth application usage in your provider dashboards

Troubleshooting

Testing Your Integration

1

Verify Configuration

Check that all environment variables are set correctly and restart your application.

2

Test Authentication

Try logging in with each OAuth provider to ensure the authentication flow works.

3

Test Integrations

  • Google: Create a form and test exporting to Google Sheets
  • Stripe: Set up a payment form and process a test transaction
  • Telegram: Configure notifications and submit a test form
4

Monitor Logs

Check your application logs for any OAuth-related errors or warnings.

With properly configured OAuth integrations, your OpnForm installation will support seamless user authentication and powerful third-party service integrations.