Back to home

AI Integration Prompts

Copy to Cursor, Claude, or ChatGPT

Use these prompts to instantly scaffold Turalogin authentication in your app. Just copy the prompt that matches your framework, paste it into your AI coding assistant, and watch it generate a complete authentication flow.

Tip: Make sure you have your TURALOGIN_API_KEY environment variable set before running the generated code. Get your API key from the dashboard.

Universal Prompt

Works with any backend framework. The AI will adapt to your project's stack.

Add Turalogin email authentication to my app. Here's how it works: 1. My backend calls Turalogin API to start auth (sends magic link to user's email) 2. User clicks the link which redirects to my app with a token 3. My backend verifies the token with Turalogin API 4. On success, I create my own session/cookie - Turalogin never touches my frontend API Details: - Base URL: https://api.turalogin.com/api/v1 - IMPORTANT: Every API request MUST include the Authorization header: Authorization: Bearer <TURALOGIN_API_KEY> Environment Variables: - TURALOGIN_API_KEY: Your API key from the dashboard - APP_LOGIN_VALIDATION_URL: The URL where magic links redirect to - Development: http://localhost:3000/auth/callback - Production: https://myapp.com/auth/callback Example fetch call: fetch('https://api.turalogin.com/api/v1/auth/start', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${process.env.TURALOGIN_API_KEY}` }, body: JSON.stringify({ email, validationUrl: process.env.APP_LOGIN_VALIDATION_URL }) }) Endpoints: POST /auth/start - Body: { email, validationUrl } → Returns: { sessionId } - validationUrl: The URL in your app where the magic link will redirect (e.g., https://myapp.com/auth/callback) - The email will contain a link like: {validationUrl}?token=abc123 POST /auth/verify - Body: { sessionId } → Returns: { token, user: { email, id } } Please create: 1. Auth endpoint to start authentication (calls Turalogin /auth/start with email and validationUrl) 2. Auth callback page that extracts token from URL and calls Turalogin /auth/verify 3. Login page/form with email input 4. After email submission, show a confirmation page telling the user to check their email for a login link from Turalogin.com (Turalogin handles the authentication emails) 5. Use proper error handling and loading states 6. Set up environment variables for both TURALOGIN_API_KEY and APP_LOGIN_VALIDATION_URL

Framework-Specific Prompts

Choose your framework for optimized code generation with best practices.

👥

Invite Users

Allow admins to invite users via email with a custom welcome message. The invite email is branded with your app name and explains that Turalogin provides secure authentication.

Add user invitation functionality using Turalogin. This allows admins to invite users via email with a custom message. How it works: 1. Admin enters the user's email and a custom welcome message 2. Your backend calls Turalogin's invite API 3. Turalogin sends a branded invite email with the admin's message 4. User clicks the link, which redirects to your app with a token 5. Your backend verifies the token (same as login flow) 6. User is now authenticated and onboarded API Details: - Base URL: https://api.turalogin.com/api/v1 - IMPORTANT: Every API request MUST include the Authorization header: Authorization: Bearer <TURALOGIN_API_KEY> Environment Variables: - TURALOGIN_API_KEY: Your API key from the dashboard - APP_INVITE_VALIDATION_URL: The URL where invite links redirect to - Development: http://localhost:3000/auth/callback - Production: https://myapp.com/auth/callback Example fetch call: fetch('https://api.turalogin.com/api/v1/auth/invite', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${process.env.TURALOGIN_API_KEY}` }, body: JSON.stringify({ email: 'newuser@example.com', message: 'Welcome to our team! Click below to get started.', validationUrl: process.env.APP_INVITE_VALIDATION_URL }) }) Endpoint: POST /auth/invite Body: { email, message, validationUrl } - email: The user's email address to invite - message: Custom message from admin (max 500 chars, shown in invite email) - validationUrl: The URL where the invite link redirects (e.g., https://myapp.com/auth/callback) Returns: { success, sessionId, message, expiresAt } Verification (same as login): POST /auth/verify - Body: { sessionId } → Returns: { token, user: { email, id } } Please create: 1. Admin invite form with email input and message textarea 2. API endpoint to send invites (calls Turalogin /auth/invite) 3. The callback page can be shared with your login flow (same /auth/verify process) 4. Show success/error states after sending invite 5. Optionally track pending invites in your database

Framework-Specific Invite Prompts

Invite prompts optimized for your framework with admin UI patterns.

Ready to integrate?

Create your Turalogin account and get your API key in minutes.