A simple web application to display OTPs (One-Time Passwords) received on your Phone. (iPhone Automation Required)
- Real-time OTP collection and display
GET /sendOTP?otp=<otp_value>&source=<source_name>
Sends an OTP to the server. The OTP and source are passed as query parameters.
📱 iPhone Automation Setup for OTP Collector
GET /getOTPs
Retrieves all received OTPs in reverse chronological order (newest first).
- Install dependencies:
npm install
- Start the server:
npm start
The server will start on http://localhost:8055
The frontend is served automatically at the root URL (http://localhost:8055
)
This project supports automatic forwarding of OTPs received via SMS on your iPhone to your server. Follow these steps to set up the automation using the Shortcuts app:
- Launch the Shortcuts app on your iPhone.
- Tap the Automation tab at the bottom.
- Tap Create Personal Automation (or the "+" if you already have automations).
- Select Message.
- Choose When I Receive a Message.
- Tap Contains and enter
OTP
(or any keyword you want to trigger the automation). - Tap Next.
Add the following actions in order:
- Action: Copy Content to Clipboard
- Input: Content (from the received message)
- Action: Set Variable
- Name:
Sender
- Value: Sender (from the received message)
- Name:
-
Action: URL Encode
- Input: Shortcut Input (the message content)
-
Action: Set Variable
- Name:
EncodedOTP
- Value: URL Encoded Text
- Name:
MIGHT BE HELPFUL: Using NGROK for Public Access
- Action: Get Contents of URL
- URL:
Replace
https://<YOUR_SERVER_URL>/sendOTP?otp=<EncodedOTP>&source=<Sender>
<YOUR_SERVER_URL>
with your actual server address (e.g., your ngrok URL or public server).
- URL:
- Tap Next.
- Disable Ask Before Running for full automation.
- Tap Done.
- Trigger: When you receive a message containing "OTP".
- Actions:
- Copy the message content.
- Store the sender.
- URL encode the OTP.
- Send the OTP and sender to your server endpoint.
- Make sure your server is running and accessible from your iPhone (use ngrok or a public IP if needed).
- The automation will only trigger for messages containing your specified keyword (e.g., "OTP").
- You can customize the keyword or add more actions as needed.
To make your local server accessible from your iPhone, you can use NGROK to expose your local server to the internet with a static domain:
- Visit the NGROK dashboard at https://dashboard.ngrok.com/domains
- Create a static domain that you can use consistently
Run the following command to expose your local server:
ngrok http --domain <NGROK DOMAIN> 8055
Replace <NGROK DOMAIN>
with your static domain from the NGROK dashboard.
Use this domain in your iPhone Shortcuts automation when setting up the "Get Contents of URL" action.