PSend

Developers

React Native & Expo

Paste a demo API key (stored only in localStorage), fill the form, and generate curl + fetch snippets for your mobile app.

Setup

  1. Create a test key in the PSend dashboard.
  2. Prefer calling PSend from your backend; use this harness only for local prototypes.
  3. In Expo or RN, use fetch against https://api.runpsend.com/v1/emails.

Test harness

Sample Expo code

// app/send-test.tsx — prototype only
import { useState } from 'react';
import { Button, TextInput, View } from 'react-native';

const API = 'https://api.runpsend.com/v1/emails';

export default function SendTest() {
  const [apiKey, setApiKey] = useState('');

  async function send() {
    const res = await fetch(API, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${apiKey}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        from: '[email protected]',
        to: '[email protected]',
        subject: 'Expo test',
        html: '<p>Hello from Expo</p>',
      }),
    });
    console.log(await res.json());
  }

  return (
    <View>
      <TextInput
        placeholder="ps_test_..."
        value={apiKey}
        onChangeText={setApiKey}
        secureTextEntry
      />
      <Button title="Send" onPress={send} />
    </View>
  );
}

Webhook listener tip

Mobile apps rarely receive webhooks directly. Expose a small backend (or serverless function), register it under Webhooks, and tunnel with ngrok while developing. Verify X-PSend-Signature on every event.

Security

Never ship live API keys in mobile binaries. Attackers can extract them from the IPA/APK. Use a backend proxy that holds ps_live_... and issues sends on behalf of authenticated users. Demo keys in this page never leave your browser localStorage.