Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 631 Bytes

File metadata and controls

31 lines (23 loc) · 631 Bytes

FastAPI Example

This example demonstrates how to use the Forminit SDK with FastAPI.

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Set environment variables:
export FORMINIT_API_KEY="your-api-key"
export FORMINIT_FORM_ID="your-form-id"
  1. Run the application:
uvicorn main:app --reload
  1. Open http://localhost:8000 in your browser

Features

  • Async form submission with AsyncForminitClient
  • FormData submission
  • Direct JSON submission with Pydantic models
  • User info tracking (IP, User-Agent, Referer)
  • Auto-generated API docs at http://localhost:8000/docs